Browse Source

Added the key end to \TaskExecution and \TaskExecDelta so to draw a circle

at the end of the rectangle to denote end of the instance.
Giuseppe Lipari 9 years ago
parent
commit
f78bd6c3fe
2 changed files with 44 additions and 12 deletions
  1. 13
    3
      rtsched-doc.tex
  2. 31
    9
      rtsched.sty

+ 13
- 3
rtsched-doc.tex View File

346
   \label{fig:resp-time}
346
   \label{fig:resp-time}
347
 \end{figure}
347
 \end{figure}
348
 
348
 
349
-It is sometimes useful to represent the end of a job execution, especially to distinguish it from preemption. In that case, you can use the following command :
349
+It is sometimes useful to represent the end of a job execution,
350
+especially to distinguish it from preemption. In that case, you can
351
+use the following command :
350
 
352
 
351
 \begin{verbatim}
353
 \begin{verbatim}
352
 \TaskEnd{i}{t}
354
 \TaskEnd{i}{t}
353
 \end{verbatim}
355
 \end{verbatim}
354
 
356
 
355
-and its periodic version detailed in Table~\ref{tab:periodic_versions} that draw little circle(s) at the specified date(s). It works in the same way as \verb+\TaskArrival+ command as shown in Figure~\ref{fig:ex1a}.
356
-
357
+\noindent and its periodic version detailed in
358
+Table~\ref{tab:periodic_versions} that draw little circle(s) at the
359
+specified date(s). It works in the same way as \verb+\TaskArrival+
360
+command as shown in Figure~\ref{fig:ex1a}. 
361
+Alternatively, you can also add the \texttt{end=1} key to the
362
+\texttt{TaskExecution} command as follows:
357
 
363
 
364
+\begin{verbatim}
365
+\TaskExecution[end=1]{1}{10}{12}
366
+\TaskExecDelta[end=1]{1}{10}{2}.
367
+\end{verbatim}
358
 
368
 
359
 
369
 
360
 \subsection{Controlling visualization}
370
 \subsection{Controlling visualization}

+ 31
- 9
rtsched.sty View File

66
 \def\RTDefLineWidth{1pt}
66
 \def\RTDefLineWidth{1pt}
67
 \def\RTDefLineStyle{solid}
67
 \def\RTDefLineStyle{solid}
68
 \def\RTDefExecHeight{1}
68
 \def\RTDefExecHeight{1}
69
-\def\RTArrowStyle{stealth} %arrow style for deadlines, arrivals and horizontal axes
69
+\def\RTArrowStyle{stealth}
70
+%arrow style for deadlines, arrivals and horizontal axes
70
 % -{Triangle 45}[length=x] with length is a more modern arrow style but requires arrows.meta tikz library (available on latest texlive but rarely up to date on linux distribution)
71
 % -{Triangle 45}[length=x] with length is a more modern arrow style but requires arrows.meta tikz library (available on latest texlive but rarely up to date on linux distribution)
71
 %-stealth is a predefined more classical arrow style
72
 %-stealth is a predefined more classical arrow style
73
+\def\RTDefEndInstance{0} 
72
 
74
 
73
 \def\RTExecLabel{\ }
75
 \def\RTExecLabel{\ }
74
 \def\RTTaskSymbol{\RTDefTaskSymbol}
76
 \def\RTTaskSymbol{\RTDefTaskSymbol}
85
 \def\RTLineWidth{\RTDefLineWidth}
87
 \def\RTLineWidth{\RTDefLineWidth}
86
 \def\RTLineStyle{\RTDefLineStyle}
88
 \def\RTLineStyle{\RTDefLineStyle}
87
 \def\RTExecHeight{\RTDefExecHeight}
89
 \def\RTExecHeight{\RTDefExecHeight}
88
-
89
-
90
-
90
+\def\RTEndInstance{\RTDefEndInstance}
91
 
91
 
92
 \define@key{RT}{height}[\RTNullWindowHeight]{\def\RTWindowHeight{#1}}
92
 \define@key{RT}{height}[\RTNullWindowHeight]{\def\RTWindowHeight{#1}}
93
 \define@key{RT}{width}[10]{\def\RTWindowLength{#1}}
93
 \define@key{RT}{width}[10]{\def\RTWindowLength{#1}}
109
 \define@key{RT}{lw}[\RTDefLineWidth]{\def\RTLineWidth{#1}}
109
 \define@key{RT}{lw}[\RTDefLineWidth]{\def\RTLineWidth{#1}}
110
 \define@key{RT}{style}[\RTDefLineStyle]{\def\RTLineStyle{#1}}
110
 \define@key{RT}{style}[\RTDefLineStyle]{\def\RTLineStyle{#1}}
111
 \define@key{RT}{exeheight}[\RTDefExecHeight]{\def\RTExecHeight{#1}}
111
 \define@key{RT}{exeheight}[\RTDefExecHeight]{\def\RTExecHeight{#1}}
112
+\define@key{RT}{end}[\RTDefEndInstance]{\def\RTEndInstance{#1}}
112
 
113
 
113
 
114
 
114
 %%
115
 %%
121
 \newdimen\yy % y position
122
 \newdimen\yy % y position
122
 \newdimen\xxx % x position
123
 \newdimen\xxx % x position
123
 \newdimen\yyy % y position
124
 \newdimen\yyy % y position
125
+\newdimen\xtmp % x position
124
 \newcount\nsx % number of horizontal slots
126
 \newcount\nsx % number of horizontal slots
125
 \newcount\nsy % number of vertical slots
127
 \newcount\nsy % number of vertical slots
126
 \newcount\nhl % number of horizontal lines
128
 \newcount\nhl % number of horizontal lines
213
   \setkeys{RT}{linecolor}%
215
   \setkeys{RT}{linecolor}%
214
   \setkeys{RT}{xscale}%
216
   \setkeys{RT}{xscale}%
215
   \setkeys{RT}{nosymbols}%
217
   \setkeys{RT}{nosymbols}%
218
+  \setkeys{RT}{end}%
216
 }
219
 }
217
 
220
 
218
 \def\@RTExecDefaultValues{
221
 \def\@RTExecDefaultValues{
219
   \setkeys{RT}{color}%
222
   \setkeys{RT}{color}%
220
   \setkeys{RT}{execlabel}%
223
   \setkeys{RT}{execlabel}%
221
   \setkeys{RT}{linecolor}%
224
   \setkeys{RT}{linecolor}%
225
+  \setkeys{RT}{end}%
222
 }
226
 }
223
 
227
 
224
 \def\RTGridEnd{
228
 \def\RTGridEnd{
365
   \@compute@xx{#3}
369
   \@compute@xx{#3}
366
   \yyy = \yy \advance \yyy by 2\sy
370
   \yyy = \yy \advance \yyy by 2\sy
367
   \begin{pgfonlayer}{foreground} 
371
   \begin{pgfonlayer}{foreground} 
368
-  \draw [\RTLineColor, thick, \RTArrowStyle-] (\xx,\yy) -- (\xx,\yyy);
372
+  \draw [\RTLineStyle, \RTLineColor, thick, \RTArrowStyle-] (\xx,\yy) -- (\xx,\yyy);
369
   \end{pgfonlayer}
373
   \end{pgfonlayer}
370
   \@RTExecDefaultValues
374
   \@RTExecDefaultValues
371
 }
375
 }
399
   \advance \xx by \xxx \xx = .5\xx
403
   \advance \xx by \xxx \xx = .5\xx
400
   \advance \yy by .5\RTExecHeight\sy
404
   \advance \yy by .5\RTExecHeight\sy
401
   \draw (\xx,\yy) node[font=\rtfont] {\RTNumberLabelSize \RTExecLabel};%\RTNumberLabelSize
405
   \draw (\xx,\yy) node[font=\rtfont] {\RTNumberLabelSize \RTExecLabel};%\RTNumberLabelSize
406
+   \if\RTEndInstance\RTDefEndInstance
407
+     \relax
408
+   \else 
409
+     \begin{pgfonlayer}{foreground} 
410
+       \draw[\RTLineColor, fill] (\xxx,\yyy) circle (1.5pt);
411
+     \end{pgfonlayer}
412
+   \fi
413
+
402
   \@RTExecDefaultValues
414
   \@RTExecDefaultValues
403
 }
415
 }
404
 %
416
 %
526
 }
538
 }
527
 
539
 
528
 % TaskEnd
540
 % TaskEnd
529
-% Task end: draws a circle when the job terminates
541
+% Task end: draws a circle, typically to indicate job termination
542
+% (see also the end key in \TaskExecDelta and \TaskExecution)
530
 % par 1: task number from 1 to n
543
 % par 1: task number from 1 to n
531
 % par 2: slot number from 0 to l-1
544
 % par 2: slot number from 0 to l-1
532
 \newcommand{\TaskEnd}[3][nocommand=1]{%
545
 \newcommand{\TaskEnd}[3][nocommand=1]{%
533
   \setkeys{RT}{#1}%
546
   \setkeys{RT}{#1}%
534
   \@compute@yy{#2}
547
   \@compute@yy{#2}
535
   \@compute@xx{#3}
548
   \@compute@xx{#3}
536
-  \yyy = \yy \advance \yyy by 2\sy%
549
+  \yyy = \yy \advance \yyy by \sy%
537
   \begin{pgfonlayer}{foreground} 
550
   \begin{pgfonlayer}{foreground} 
538
-  \draw[fill] (\xx,\yy) circle (1.5pt);
551
+  \draw[\RTLineColor, fill=\RTTaskColor] (\xx,\yyy) circle (1.5pt);
539
   \end{pgfonlayer}
552
   \end{pgfonlayer}
540
   \@RTExecDefaultValues%
553
   \@RTExecDefaultValues%
541
 }
554
 }
603
    \draw [fill=\RTTaskColor,\RTTaskFill,draw=\RTLineColor, thick] (\xx,\yy) rectangle (\xxx,\yyy);
616
    \draw [fill=\RTTaskColor,\RTTaskFill,draw=\RTLineColor, thick] (\xx,\yy) rectangle (\xxx,\yyy);
604
   \advance \xx by \xxx \xx = .5\xx
617
   \advance \xx by \xxx \xx = .5\xx
605
    \draw (\xx,\yy) node[above, font=\rtfont] {\RTTaskLabelSize \RTExecLabel}; %\RTNumberLabelSize
618
    \draw (\xx,\yy) node[above, font=\rtfont] {\RTTaskLabelSize \RTExecLabel}; %\RTNumberLabelSize
619
+   \if\RTEndInstance\RTDefEndInstance
620
+     \relax
621
+   \else 
622
+     \begin{pgfonlayer}{foreground} 
623
+       \draw[\RTLineColor, fill] (\xxx,\yyy) circle (1.5pt);
624
+     \end{pgfonlayer}
625
+   \fi
606
   \@RTExecDefaultValues
626
   \@RTExecDefaultValues
607
 }
627
 }
608
 
628
 
622
 }
642
 }
623
 
643
 
624
 
644
 
625
-
626
 % 
645
 % 
627
 % TaskRespTime
646
 % TaskRespTime
628
 % par 1:  task
647
 % par 1:  task
664
   \renewcommand<>{\TaskExecDelta}[4][nocommand=1]{
683
   \renewcommand<>{\TaskExecDelta}[4][nocommand=1]{
665
     \only#5{\beameroriginal{\TaskExecDelta}[#1]{#2}{#3}{#4}}
684
     \only#5{\beameroriginal{\TaskExecDelta}[#1]{#2}{#3}{#4}}
666
   }
685
   }
686
+  \renewcommand<>{\TaskExecDeltaEnd}[4][nocommand=1]{
687
+    \only#5{\beameroriginal{\TaskExecDeltaEnd}[#1]{#2}{#3}{#4}}
688
+  }
667
   \renewcommand<>{\TaskNExecDelta}[6][nocommand=1]{
689
   \renewcommand<>{\TaskNExecDelta}[6][nocommand=1]{
668
     \only#7{\beameroriginal{\TaskNExecDelta}[#1]{#2}{#3}{#4}{#5}{#6}}
690
     \only#7{\beameroriginal{\TaskNExecDelta}[#1]{#2}{#3}{#4}{#5}{#6}}
669
   }
691
   }

Loading…
Cancel
Save