Repository Public MIT Research preview
1% MA02-F02 — Gantt de l'exemple guidé de la séance 01, exécuté par trois agents, avec ses dépendances.2% Idée : un travail ne part que lorsque TOUTES ses dépendances ont réussi (jonction) ; trois travaux partent3% ensemble dès que A finit (éventail). Animé en quatre temps dans la présentation : \MBEtape vaut 1, 2, 3 ou 4 et4% place un curseur ; les travaux finis, en cours et en attente n'ont pas le même tracé. Sans \MBEtape : état final.5% Données : exécution réelle du moteur (MA02-donnees.tex). Une minute de l'exemple = 1 000 ms simulées.6\input{MA02-donnees.tex}%7\ifdefined\MBEtape\else\def\MBEtape{4}\fi8\begin{tikzpicture}[x=1mm, y=1mm]9 \path (0,0) rectangle (142,56);10 \def\ech{3.36}% mm par minute11 \def\xo{22}%12 \pgfmathsetmacro{\T}{{\MBExInstants}[\MBEtape-1]}13 \xdef\MBfinis{0}14 \foreach \k in {1,2,3}{\node[atlas note, anchor=east, text=maTexte] at (\xo-2,53-12*\k) {agent-\k};}15 \foreach \i/\k/\deb/\fin/\crit in \MBExAvantBarres {16 \pgfmathsetmacro{\y}{53-12*\k}17 \pgfmathtruncatemacro{\etat}{\fin <= \T ? 2 : (\deb < \T ? 1 : 0)}18 \ifnum\crit=1 \def\coul{maRisque}\else\def\coul{maActeur}\fi19 \ifcase\etat20 \node[draw=\coul, fill=maFond, dash pattern=on 1.6pt off 1.4pt, line width=.8pt, text=maDiscret, font=\AtlasSizeTiny\bfseries, inner sep=0pt,21 anchor=west, minimum width=(\fin-\deb)*\ech mm-.6mm, minimum height=6.2mm] (g\i) at (\xo+\deb*\ech+.3,\y) {\i};22 \or23 \node[draw=\coul, fill=maPanneau, line width=1.8pt, text=maTexte, font=\AtlasSizeTiny\bfseries, inner sep=0pt,24 anchor=west, minimum width=(\fin-\deb)*\ech mm-.6mm, minimum height=6.2mm] (g\i) at (\xo+\deb*\ech+.3,\y) {\i};25 \or26 \ifnum\crit=127 \node[ma tache critique, anchor=west, minimum width=(\fin-\deb)*\ech mm-.6mm, minimum height=6.2mm, inner xsep=0pt,28 font=\AtlasSizeTiny\bfseries] (g\i) at (\xo+\deb*\ech+.3,\y) {\i};29 \else30 \node[ma tache, anchor=west, minimum width=(\fin-\deb)*\ech mm-.6mm, minimum height=6.2mm, inner xsep=0pt,31 font=\AtlasSizeTiny\bfseries] (g\i) at (\xo+\deb*\ech+.3,\y) {\i};32 \fi33 \pgfmathtruncatemacro{\tmp}{\MBfinis+1}\xdef\MBfinis{\tmp}34 \fi}35 % Dépendances entre couloirs : un trait part de la fin de la tâche amont et tombe sur le début de la tâche aval.36 \begin{scope}[on background layer]37 \foreach \u/\v in \MBExAretes {38 \pgfextracty{\dimen0}{\pgfpointanchor{g\u}{center}}\pgfextracty{\dimen2}{\pgfpointanchor{g\v}{center}}39 \ifdim\dimen0>\dimen240 \draw[atlas arrow muted, line width=.8pt, shorten <=0pt] (g\u.east) -| ([xshift=.5mm]g\v.north west);41 \else\ifdim\dimen0<\dimen242 \draw[atlas arrow muted, line width=.8pt, shorten <=0pt] (g\u.east) -| ([xshift=.5mm]g\v.south west);43 \fi\fi}44 \end{scope}45 % Curseur du temps46 \draw[maValide, line width=1.3pt] (\xo+\T*\ech,8) -- ++(0,43);47 \node[atlas tag=maValide, anchor=south] at (\xo+\T*\ech,51.2) {t = \pgfmathprintnumber{\T} min};48 % Axe49 \draw[maNeutre, line width=.8pt, -{Stealth[length=4pt,width=3.6pt]}] (\xo,8) -- ++(117,0);50 \foreach \t in {0,5,10,15,20,25,30}{\draw[maNeutre, line width=.6pt] (\xo+\t*\ech,8) -- ++(0,-1.1) node[atlas note, anchor=north, inner sep=1pt] {\t};}51 \node[atlas note, anchor=north east, inner sep=1pt] at (142,6.9) {min};52 % Légende53 \node[ma tache, minimum width=7mm, minimum height=3.6mm, inner sep=0pt] at (4,2) {};54 \node[atlas note, anchor=west, text=maTexte] at (8,2) {fini};55 \node[draw=maActeur, fill=maPanneau, line width=1.8pt, minimum width=7mm, minimum height=3.6mm, inner sep=0pt] at (20,2) {};56 \node[atlas note, anchor=west, text=maTexte] at (24.2,2) {en cours};57 \node[draw=maActeur, dash pattern=on 1.6pt off 1.4pt, line width=.8pt, minimum width=7mm, minimum height=3.6mm, inner sep=0pt] at (43,2) {};58 \node[atlas note, anchor=west, text=maTexte] at (47.2,2) {pas encore prêt};59 \node[atlas note, anchor=west, text=maRisque] at (72,2) {contour corail : chemin critique};60 \node[atlas note, anchor=east, text=maTexte, font=\AtlasTabularFont\AtlasSizeTiny\bfseries] at (142,2) {finis : \MBfinis\,/\,10};61\end{tikzpicture}62