Sfoglia il codice sorgente

package multido removed, add of periodic commands

Antoine Bertout 9 anni fa
parent
commit
6d3cb88343
3 ha cambiato i file con 225 aggiunte e 140 eliminazioni
  1. 8
    8
      rtsched-beamer-doc.tex
  2. 125
    121
      rtsched-doc.tex
  3. 92
    11
      rtsched.sty

+ 8
- 8
rtsched-beamer-doc.tex Vedi File

@@ -76,15 +76,15 @@
76 76
       }
77 77
       \RTBox<23>{6}{10}
78 78
 
79
-      \multido{\n=0+4}{5}{        % 5 instances of period 4 
80
-        \TaskArrDead{1}{\n}{4}    % draw the arrival and deadline
81
-        \TaskExecDelta{1}{\n}{1}  % draw execution (highest priority), 
82
-        % from \n to \n+1
83
-      }
79
+           
80
+      \TaskArrDead{1}{0}{4}{4}{5}    % draws the arrivals and deadlines
81
+      \TaskExecDelta{1}{0}{1}{4}{5}  % draws execution (highest priority)
82
+                                     % for 5 instances of period 4 
83
+     
84
+            
85
+      \TaskArrDead{2}{0}{6}{6}{3}    % draws the arrivals and deadlines
86
+                                     % for 3 instances of period 6 
84 87
       
85
-      \multido{\n=0+6}{3}{        % 3 instances of period 6 
86
-        \TaskArrDead{2}{\n}{6}    % draw the arrival and deadline
87
-      }
88 88
       % no simple formula for lowest priority, sorry!
89 89
       \TaskExecution{2}{1}{4}
90 90
       \TaskExecution{2}{6}{8}

+ 125
- 121
rtsched-doc.tex Vedi File

@@ -2,7 +2,6 @@
2 2
 
3 3
 \usepackage{rtsched}
4 4
 \usepackage{url}
5
-\usepackage{multido}
6 5
 
7 6
 \title{The \texttt{rtsched} package for \LaTeX \\ (version 2.0)}
8 7
 \author{Giuseppe Lipari}
@@ -69,11 +68,33 @@ using the following commands:
69 68
 \noindent where \texttt{i} is the task index (from 1 to \texttt{n}
70 69
 included), \texttt{t} is the arrival time, and \texttt{reld} is the
71 70
 relative deadline; an absolute deadline will be drawn at \texttt{t +
72
-  reld}.
71
+  reld}. If you only want to draw absolute deadlines, you can simply use the following command:
72
+\begin{verbatim}
73
+\TaskDeadline{i}{t}
74
+\end{verbatim}
75
+\noindent that works in the same way as \verb+\TaskArrival{i}{t}+.
76
+
73 77
 
74 78
 In this example there are a lot of repetitions. These can be avoided
75
-if you use the \texttt{multido} macro from the \texttt{multido} package, as shown in the example of
76
-Figure \ref{fig:ex1a}.
79
+if you use the periodic versions of some commands, as shown in the example of
80
+Figure \ref{fig:ex1a}. Available periodic versions of the commands can be found in Table~\ref{tab:periodic_versions}. The periodic versions take two additional arguments corresponding to the period and to the number of instances desired.
81
+
82
+\begin{table}[!htbp]
83
+\begin{tabular}{|l|l|}
84
+ \hline
85
+  Atomic version & Periodic version  \\
86
+ \hline
87
+ \verb+\TaskArrival{i}{t}+ & \verb+\TaskNArrival{i}{t}{p}{n}+ \\
88
+ \verb+\TaskDeadline{i}{t}+ & \verb+\TaskNDeadline{i}{t}{p}{n}+ \\
89
+ \verb+\TaskArrDeadl{i}{t}{reld}+ & \verb+\TaskNArrDeadl{i}{t}{reld}{p}{n}+  \\
90
+ \verb+\TaskExecDelta{i}{t}{delta}+ & \verb+\TaskNExecDelta{i}{t}{delta}{p}{n}+\\
91
+  \hline
92
+\end{tabular}
93
+\caption{Table of periodic commands where p stands for the period and n for the number of instances}
94
+\label{tab:periodic_versions}
95
+\end{table}
96
+
97
+
77 98
 
78 99
 To draw the execution rectangle, you can use the following command:
79 100
 \begin{verbatim}
@@ -160,15 +181,14 @@ from periods (the so-called \emph{constrained deadline tasks}).
160 181
 \begin{figure}[!htbp]
161 182
   \centering
162 183
   \begin{RTGrid}{2}{20}
163
-    \multido{\n=0+4}{5}{        % 5 instances of period 4 
164
-      \TaskArrDead{1}{\n}{4}    % draws the arrival and deadline
165
-      \TaskExecDelta{1}{\n}{1}  % draws execution (highest priority), 
166
-                                % from \n to \n+1
167
-    }
168
- 
169
-    \multido{\n=0+6}{3}{        % 3 instances of period 6 
170
-      \TaskArrDead{2}{\n}{6}    % draws the arrival and deadline
171
-    }
184
+                                   
185
+    \TaskNArrDead{1}{0}{4}{4}{5}    % draws the arrivals and deadlines
186
+    \TaskNExecDelta{1}{0}{1}{4}{5}  % draws executions (highest priority) 
187
+                                    % for 5 instances of period 4 
188
+
189
+                                    % draws the arrival and deadline
190
+    \TaskNArrDead{2}{0}{6}{6}{3}    % for 3 instances of period 6 
191
+    
172 192
     % no simple formula for lowest priority, sorry!
173 193
     \TaskExecution{2}{1}{4}
174 194
     \TaskExecution{2}{6}{8}
@@ -178,15 +198,14 @@ from periods (the so-called \emph{constrained deadline tasks}).
178 198
 
179 199
 \begin{verbatim}
180 200
   \begin{RTGrid}{2}{20}
181
-    \multido{\n=0+4}{5}{        % 4 instances of period 4 
182
-      \TaskArrDead{1}{\n}{4}    % draws the arrival and deadline
183
-      \TaskExecDelta{1}{\n}{1}  % draws execution (highest priority), 
184
-                                % from \n to \n+1
185
-    }
186
- 
187
-    \multido{\n=0+6}{3}{        % 3 instances of period 6 
188
-      \TaskArrDead{2}{\n}{6}    % draws the arrival and deadline
189
-    }
201
+                                   
202
+    \TaskNArrDead{1}{0}{4}{4}{5}    % draws the arrivals and deadlines
203
+    \TaskNExecDelta{1}{0}{1}{4}{5}  % draws executions (highest priority) 
204
+                                    % for 5 instances of period 4 
205
+
206
+   	\TaskNArrDead{2}{0}{6}{6}{3}    % draws the arrival and deadline
207
+                                    % for 3 instances of period 6 
208
+    
190 209
     % no simple formula for lowest priority, sorry!
191 210
     \TaskExecution{2}{1}{4}
192 211
     \TaskExecution{2}{6}{8}
@@ -194,29 +213,29 @@ from periods (the so-called \emph{constrained deadline tasks}).
194 213
     \TaskExecution{2}{13}{16}    
195 214
   \end{RTGrid}
196 215
 \end{verbatim}
197
-  \caption{Using multido to avoid repetitions}
216
+  \caption{Using periodic commands to avoid repetitions}
198 217
   \label{fig:ex1a}
199 218
 \end{figure}
200 219
 
201 220
 \begin{figure}[!htbp]
202 221
   \centering
203 222
   \begin{RTGrid}{3}{14}
204
-    \multido{\n=0+3}{4}{        % 4 instances of period 3, starting from 0 
205
-      \TaskArrival{1}{\n}       % draws only the arrival
206
-      \TaskExecDelta{1}{\n}{1}  % draws execution (highest priority), 
207
-                                % from \n to \n+1
208
-    }
223
+                                      
224
+    \TaskNArrival{1}{0}{3}{4}        % draws only the arrivals 
225
+    \TaskNExecDelta{1}{0}{1}{3}{4}   % draws executions (highest priority)
226
+                                     % for 4 instances of period 3 
227
+                               
209 228
  
210
-    \multido{\n=3+4}{3}{        % 3 instances of period 4, starting from 3 
211
-      \TaskArrival{2}{\n}       % draws only the arrival
212
-    }
229
+                                   
230
+    \TaskNArrival{2}{3}{4}{3}        % draws only the arrivals
231
+                                     % 3 instances of period 4, starting from 3 
213 232
     \TaskExecDelta{2}{4}{1}
214 233
     \TaskExecDelta{2}{7}{1}
215 234
     \TaskExecDelta{2}{11}{1}
216 235
 
217
-    \multido{\n=1+5}{3}{        % 3 instances of period 5, starting from 1 
218
-      \TaskArrival{3}{\n}       % draws only the arrival
219
-    }
236
+                                     % 3 instances of period 5, starting from 1 
237
+    \TaskNArrival{3}{1}{5}{3}        % draws only the arrivals
238
+
220 239
     \TaskExecDelta{3}{1}{1}
221 240
     \TaskExecDelta{3}{8}{1}
222 241
     \TaskExecDelta{3}{12}{1}
@@ -224,20 +243,21 @@ from periods (the so-called \emph{constrained deadline tasks}).
224 243
 
225 244
 \begin{verbatim}
226 245
   \begin{RTGrid}{3}{14}
227
-    \multido{\n=0+3}{4}{        % 4 instances of period 3 
228
-      \TaskArrival{1}{\n}       % draws only the arrival
229
-      \TaskExecDelta{1}{\n}{1}} % draws execution (highest priority), 
230
-                                % from \n to \n+1
246
+                                      
247
+    \TaskNArrival{1}{0}{3}{4}        % draws only the arrivals 
248
+    \TaskNExecDelta{1}{0}{1}{3}{4}   % draws executions (highest priority)
249
+                                     % for 4 instances of period 3 
250
+                               
231 251
  
232
-    \multido{\n=3+4}{3}{        % 3 instances of period 4, starting from 3 
233
-      \TaskArrival{2}{\n}}      % draws only the arrival
234
-
252
+                                   
253
+    \TaskNArrival{2}{3}{4}{3}        % draws only the arrivals
254
+                                     % 3 instances of period 4, starting from 3 
235 255
     \TaskExecDelta{2}{4}{1}
236 256
     \TaskExecDelta{2}{7}{1}
237 257
     \TaskExecDelta{2}{11}{1}
238 258
 
239
-    \multido{\n=1+5}{3}{        % 3 instances of period 5, starting from 1 
240
-      \TaskArrival{3}{\n}}      % draws only the arrival
259
+                                     % 3 instances of period 5, starting from 1 
260
+    \TaskNArrival{3}{1}{5}{3}        % draws only the arrivals
241 261
 
242 262
     \TaskExecDelta{3}{1}{1}
243 263
     \TaskExecDelta{3}{8}{1}
@@ -251,16 +271,14 @@ from periods (the so-called \emph{constrained deadline tasks}).
251 271
 \begin{figure}[!htbp]
252 272
   \centering
253 273
   \begin{RTGrid}[width=8cm]{2}{15}
254
-    \multido{\n=0+6}{3}{
255
-    \TaskArrDead{1}{\n}{3}}
256
-    \multido{\n=2+8}{2}{
257
-    \TaskArrDead{2}{\n}{5}}
274
+   \TaskNArrDead{1}{0}{3}{6}{3}
275
+   \TaskNArrDead{2}{2}{5}{8}{2}
258 276
   \end{RTGrid}
259 277
 \begin{verbatim}
260
-    \multido{\n=0+6}{3}{
261
-    \TaskArrDead{1}{\n}{3}}
262
-    \multido{\n=2+8}{2}{
263
-    \TaskArrDead{2}{\n}{5}}
278
+  \begin{RTGrid}[width=8cm]{2}{15}
279
+   \TaskNArrDead{1}{0}{3}{6}{3}
280
+   \TaskNArrDead{2}{2}{5}{8}{2}
281
+  \end{RTGrid}
264 282
 \end{verbatim}
265 283
   \caption{Deadlines less than periods}
266 284
   \label{fig:ex1c}
@@ -273,40 +291,42 @@ style. An example is in Figure~\ref{fig:resp-time} that uses command
273 291
 \begin{figure}
274 292
   \centering
275 293
   \begin{RTGrid}{2}{20}
276
-    \multido{\n=0+4}{5}{        % 5 instances of period 4 
277
-      \TaskArrDead{1}{\n}{4}    % draws the arrival and deadline
278
-      \TaskExecDelta{1}{\n}{1}  % draws execution (highest priority), 
279
-                                % from \n to \n+1
280
-    }
281
- 
282
-    \multido{\n=0+6}{3}{        % 3 instances of period 6 
283
-      \TaskArrDead{2}{\n}{6}    % draws the arrival and deadline
284
-    }
294
+  
295
+    \TaskNArrDead{1}{0}{4}{4}{5}    % draws the arrivals and deadlines
296
+    \TaskNExecDelta{1}{0}{1}{4}{5}  % draws executions (highest priority) 
297
+                                   % for 5 instances of period 4 
285 298
 
286
-    \TaskRespTime{2}{0}{4}
287
-    \TaskExecution{2}{1}{4}
288
-    \TaskRespTime{2}{6}{4}
289
-    \TaskExecution{2}{6}{8}
290
-    \TaskExecution{2}{9}{10}
291
-    \TaskRespTime{2}{12}{4}
292
-    \TaskExecution{2}{13}{16}    
299
+ 
300
+    \TaskNArrDead{2}{0}{6}{6}{3}   % draws the arrivals and deadlines
301
+                                   % for 3 instances of period 6 
302
+
303
+    \TaskRespTime{2}{0}{4}         % draws the hatched rectangle in [0,4]
304
+    \TaskExecution{2}{1}{4}        % draws execution (over the previous rectangle)
305
+    \TaskRespTime{2}{6}{4}         % draws the hatched rectangle in [6,10]
306
+    \TaskExecution{2}{6}{8}        % draws execution
307
+    \TaskExecution{2}{9}{10}       % draws execution
308
+    \TaskRespTime{2}{12}{4}        % draws the hatched rectangle in [12,16]
309
+    \TaskExecution{2}{13}{16}      % draws execution   
293 310
   \end{RTGrid}  
294 311
 \begin{verbatim}
295 312
   \begin{RTGrid}{2}{20}
296
-    \multido{\n=0+4}{5}{         
297
-      \TaskArrDead{1}{\n}{4}    
298
-      \TaskExecDelta{1}{\n}{1}}
299
-    \multido{\n=0+6}{3}{        
300
-      \TaskArrDead{2}{\n}{6}}
301
-
302
-    \TaskRespTime{2}{0}{4}    % draws the hatched rectangle in [0,4]
303
-    \TaskExecution{2}{1}{4}   % draws execution (over the previous rectangle)
304
-    \TaskRespTime{2}{6}{4}    % draws the hatched rectangle in [6,10]
305
-    \TaskExecution{2}{6}{8}   % draws execution
306
-    \TaskExecution{2}{9}{10}  % draws execution
307
-    \TaskRespTime{2}{12}{4}   % draws the hatched rectangle in [12,16]
308
-    \TaskExecution{2}{13}{16} % draws execution   
309
-  \end{RTGrid}  
313
+  
314
+    \TaskNArrDead{1}{0}{4}{4}{5}    % draws the arrivals and deadlines
315
+    \TasNkExecDelta{1}{0}{1}{4}{5}  % draws executions (highest priority) 
316
+                                    % for 5 instances of period 4 
317
+
318
+ 
319
+    \TaskNArrDead{2}{0}{6}{6}{3}   % draws the arrivals and deadlines
320
+                                   % for 3 instances of period 6 
321
+
322
+    \TaskRespTime{2}{0}{4}         % draws the hatched rectangle in [0,4]
323
+    \TaskExecution{2}{1}{4}        % draws execution (over the previous rectangle)
324
+    \TaskRespTime{2}{6}{4}         % draws the hatched rectangle in [6,10]
325
+    \TaskExecution{2}{6}{8}        % draws execution
326
+    \TaskExecution{2}{9}{10}       % draws execution
327
+    \TaskRespTime{2}{12}{4}        % draws the hatched rectangle in [12,16]
328
+    \TaskExecution{2}{13}{16}      % draws execution   
329
+  \end{RTGrid}   
310 330
 \end{verbatim}
311 331
   \caption{Example with TaskRespTime}
312 332
   \label{fig:resp-time}
@@ -323,11 +343,9 @@ task symbols.
323 343
   \centering
324 344
   %% no grid and no symbols
325 345
   \begin{RTGrid}[nogrid=1,nosymbols=1]{2}{20}
326
-    \multido{\n=0+4}{5}{         
327
-      \TaskArrDead{1}{\n}{4}    
328
-      \TaskExecDelta{1}{\n}{1}}
329
-    \multido{\n=0+6}{3}{         
330
-        \TaskArrDead{2}{\n}{6}}
346
+    \TaskNArrDead{1}{0}{4}{4}{5}    
347
+    \TaskNExecDelta{1}{0}{1}{4}{5}  
348
+    \TaskNArrDead{2}{0}{6}{6}{3}
331 349
     \TaskExecution{2}{1}{4}
332 350
     \TaskExecution{2}{6}{8}
333 351
     \TaskExecution{2}{9}{10}
@@ -336,11 +354,9 @@ task symbols.
336 354
 \begin{verbatim}
337 355
   %% no grid and no symbols
338 356
   \begin{RTGrid}[nogrid=1,nosymbols=1]{2}{20}
339
-    \multido{\n=0+4}{5}{         
340
-      \TaskArrDead{1}{\n}{4}    
341
-      \TaskExecDelta{1}{\n}{1}}
342
-    \multido{\n=0+6}{3}{         
343
-        \TaskArrDead{2}{\n}{6}}
357
+    \TaskNArrDead{1}{0}{4}{4}{5}    
358
+    \TaskNExecDelta{1}{0}{1}{4}{5}  
359
+    \TaskNArrDead{2}{0}{6}{6}{3}
344 360
     \TaskExecution{2}{1}{4}
345 361
     \TaskExecution{2}{6}{8}
346 362
     \TaskExecution{2}{9}{10}
@@ -366,12 +382,9 @@ smaller. Notice that you can directly specify colors using the TikZ
366 382
   %% specification of the symbol, as the symbol is already used in a
367 383
   %% math environment inside the macro
368 384
   \begin{RTGrid}[width=8cm,symbol=\gamma,nonumbers=1,labelsize=\small]{2}{20}
369
-    \multido{\n=0+4}{5}{         
370
-      \TaskArrDead{1}{\n}{4}    
371
-      \TaskExecDelta{1}{\n}{1}}
372
-    \multido{\n=0+6}{3}{         
373
-      \TaskArrDead{2}{\n}{6}    
374
-    }
385
+    \TaskNArrDead{1}{0}{4}{4}{5}    
386
+    \TaskNExecDelta{1}{0}{1}{4}{5}
387
+    \TaskNArrDead{2}{0}{6}{6}{3}    
375 388
     %% here, the border changes to cyan, and the fill to white
376 389
     \TaskExecution[linecolor=cyan,color=white]{2}{1}{4}
377 390
     %% the next two boxes are filled with red instead of gray
@@ -387,12 +400,9 @@ smaller. Notice that you can directly specify colors using the TikZ
387 400
   %% specification of the symbol, as the symbol is already used in a
388 401
   %% math environment inside the macro
389 402
   \begin{RTGrid}[symbol=\gamma,nonumbers=1,labelsize=\Large]{2}{20}
390
-    \multido{\n=0+4}{5}{         
391
-      \TaskArrDead{1}{\n}{4}    
392
-      \TaskExecDelta{1}{\n}{1}}
393
-    \multido{\n=0+6}{3}{         
394
-      \TaskArrDead{2}{\n}{6}    
395
-    }
403
+    \TaskNArrDead{1}{0}{4}{4}{5}    
404
+    \TaskNExecDelta{1}{0}{1}{4}{5}
405
+    \TaskNArrDead{2}{0}{6}{6}{3}  
396 406
     %% here, the border changes to cyan, and the fill to white
397 407
     \TaskExecution[linecolor=cyan,color=white]{2}{1}{4}
398 408
     %% the next two boxes are filled with red instead of gray
@@ -424,12 +434,10 @@ number in the time line, using the \texttt{numoffset=12} option.
424 434
     \RowLabel{1}{Server}
425 435
     %% the symbol for the second row
426 436
     \RowLabel{2}{$\Pi_2$}
427
-    \multido{\n=0+4}{5}{         
428
-      \TaskArrDead{1}{\n}{4}    
429
-      \TaskExecDelta{1}{\n}{1}}
430
-    \multido{\n=0+6}{3}{         
431
-      \TaskArrDead{2}{\n}{6}
432
-    }
437
+    \TaskNArrDead{1}{0}{4}{4}{5}    
438
+    \TaskNExecDelta{1}{0}{1}{4}{5}  
439
+    \TaskNArrDead{2}{0}{6}{6}{3}
440
+    
433 441
     \TaskExecution{2}{1}{4}
434 442
     \TaskExecution{2}{6}{8}
435 443
     \TaskExecution{2}{9}{10}
@@ -442,12 +450,10 @@ number in the time line, using the \texttt{numoffset=12} option.
442 450
     \RowLabel{1}{Server}
443 451
     %% the symbol for the second row
444 452
     \RowLabel{2}{$\Pi_2$}
445
-    \multido{\n=0+4}{5}{         
446
-      \TaskArrDead{1}{\n}{4}    
447
-      \TaskExecDelta{1}{\n}{1}}
448
-    \multido{\n=0+6}{3}{         
449
-      \TaskArrDead{2}{\n}{6}
450
-    }
453
+    \TaskNArrDead{1}{0}{4}{4}{5}    
454
+    \TaskNExecDelta{1}{0}{1}{4}{5}  
455
+    \TaskNArrDead{2}{0}{6}{6}{3}
456
+    
451 457
     \TaskExecution{2}{1}{4}
452 458
     \TaskExecution{2}{6}{8}
453 459
     \TaskExecution{2}{9}{10}
@@ -505,9 +511,8 @@ to highlight a portion of the schedule with \texttt{RTBox}:
505 511
   \centering
506 512
   \begin{RTGrid}{2}{20}
507 513
     \RTBox{12}{16}
508
-    \multido{\n=0+6}{4}{
509
-      \TaskArrival{1}{\n}
510
-      \TaskExecDelta{1}{\n}{2}}
514
+    \TaskArrival{1}{0}{6}{4}
515
+    \TaskExecDelta{1}{0}{2}{6}{4}
511 516
     \TaskArrival{2}{10}
512 517
     \TaskExecDelta[exeheight=1.5]{2}{10}{3}
513 518
     \Activation{1}{8}{2}{10}
@@ -516,9 +521,8 @@ to highlight a portion of the schedule with \texttt{RTBox}:
516 521
 \begin{verbatim}
517 522
   \begin{RTGrid}{2}{20}
518 523
     \RTBox{12}{16}
519
-    \multido{\n=0+6}{4}{
520
-      \TaskArrival{1}{\n}
521
-      \TaskExecDelta{1}{\n}{2}}
524
+    \TaskArrival{1}{0}{6}{4}
525
+    \TaskExecDelta{1}{0}{2}{6}{4}
522 526
     \TaskArrival{2}{10}
523 527
     \TaskExecDelta[exeheight=1.5]{2}{10}{3}
524 528
     \Activation{1}{8}{2}{10}

+ 92
- 11
rtsched.sty Vedi File

@@ -278,9 +278,11 @@
278 278
     \@RTExecDefaultValues%
279 279
 }
280 280
 
281
-%% Task Arrival: draws an up arrow at the specified slot
282
-%% #1  : task number from 1 to n
283
-%% #2  : slot number from 0 to l-1
281
+%
282
+% TaskArrival
283
+% Task arrival: draws an up arrow at the specified slot
284
+% par 1  : task number from 1 to n
285
+% par 2  : slot number from 0 to l-1
284 286
 \newcommand{\TaskArrival}[3][nocommand=1]{%
285 287
     \setkeys{RT}{#1}%
286 288
     \@compute@yy{#2}
@@ -289,14 +291,28 @@
289 291
      \begin{pgfonlayer}{foreground} 
290 292
     \draw [\RTLineColor, thick,-\RTArrowStyle] (\xx,\yy) -- (\xx,\yyy);
291 293
      \end{pgfonlayer}
292
-
293 294
     \@RTExecDefaultValues%
294 295
 }
295 296
 
296
-%% Task Arrival and deadline: draws an up arrow and a down arrow at the specified slots
297
-%% #1  : task number from 1 to n
298
-%% #2  : slot number from 0 to l-1
299
-%% #3  : relative deadline
297
+%
298
+% TaskNArrival
299
+% Task arrivals: draws periodically up arrows from the specified slot
300
+% par 1  : task number from 1 to n
301
+% par 2  : slot number from 0 to l-1
302
+% par 3  : period
303
+% par 4  : number of instances
304
+\newcommand{\TaskNArrival}[5][nocommand=1]{%
305
+ \foreach \instance [evaluate = \instance as \activation using (#3 + \instance * #4)] in {0,...,\numexpr #5-1}{
306
+ \TaskArrival{#2}{\activation}{#4}
307
+ }
308
+}
309
+
310
+%
311
+% TaskArrDead
312
+% Task arrival and deadline: draws an up arrow and a down arrow at the specified slots
313
+% par 1  : task number from 1 to n
314
+% par 2  : slot number from 0 to l-1
315
+% par 3  : relative deadline
300 316
 \newcommand{\TaskArrDead}[4][nocommand=1]{
301 317
   \setkeys{RT}{#1}%
302 318
   \@compute@yy{#2}
@@ -312,10 +328,26 @@
312 328
   \@RTExecDefaultValues
313 329
 }
314 330
 
331
+%
332
+% TaskNArrDead
333
+% Task arrivals and deadlines: draws periodically up arrows and down arrows from the specified slots
334
+% par 1  : task number from 1 to n
335
+% par 2  : slot number from 0 to l-1
336
+% par 3  : relative deadline
337
+% par 4  : period
338
+% par 5  : number of instances
339
+
340
+\newcommand{\TaskNArrDead}[6][nocommand=1]{
341
+ \foreach \instance [evaluate = \instance as \activation using (#3 + \instance * #5)] in {0,...,\numexpr #6-1}{
342
+ \TaskArrDead{#2}{\activation}{#4}
343
+ }
344
+}
315 345
 
316
-%% Task Deadline: draws a down arrow at the specified slot
317
-%% #1  : task number from 1 to n
318
-%% #2  : slot number from 0 to l-1
346
+%
347
+% TaskDeadline
348
+% Task deadline: draws a down arrow at the specified slot
349
+% par 1  : task number from 1 to n
350
+% par 2  : slot number from 0 to l-1
319 351
 \newcommand{\TaskDeadline}[3][nocommand=1]{
320 352
   \setkeys{RT}{#1}%
321 353
   \@compute@yy{#2}
@@ -327,6 +359,25 @@
327 359
   \@RTExecDefaultValues
328 360
 }
329 361
 
362
+%
363
+% TaskNDeadline
364
+% periodic task deadlines: draws periodically down arrows from the specified slot 
365
+% par 1  : task number from 1 to n
366
+% par 2  : slot number from 0 to l-1
367
+% par 3  : period
368
+% par 4  : number of instances
369
+\newcommand{\TaskNDeadline}[5][nocommand=1]{%
370
+ \foreach \instance [evaluate = \instance as \activation using (#3 + \instance * #4)] in {0,...,\numexpr #5-1}{
371
+ \TaskDeadline{#2}{\activation}{#4}
372
+ }
373
+}
374
+
375
+%
376
+% TaskExecution
377
+% Task execution: draws an execution from start time to finish time
378
+% par 1:  task
379
+% par 2:  start time
380
+% par 3:  finish time
330 381
 \newcommand{\TaskExecution}[4][nocommand=1]{
331 382
   \setkeys{RT}{#1}%
332 383
   \@compute@yy{#2}
@@ -475,6 +526,7 @@
475 526
 
476 527
 % 
477 528
 % TaskExecDelta
529
+% Task execution delta: draws an execution from start time during delta time
478 530
 % par 1:  task
479 531
 % par 2:  start time
480 532
 % par 3:  delta
@@ -492,6 +544,22 @@
492 544
   \@RTExecDefaultValues
493 545
 }
494 546
 
547
+% 
548
+% TaskNExecDelta
549
+% Task execution deltas: draws periodically executions from start time during delta time
550
+% par 1:  task
551
+% par 2:  start time
552
+% par 3:  delta
553
+% par 4:  period
554
+% par 5:  number of instances
555
+
556
+\newcommand{\TaskNExecDelta}[6][nocommand=1]{
557
+ \foreach \instance [evaluate = \instance as \activation using (#3 + \instance * #5)] in {0,...,\numexpr #6-1}{
558
+ \TaskExecDelta{#2}{\activation}{#4}
559
+ }
560
+}
561
+
562
+
495 563
 
496 564
 % 
497 565
 % TaskRespTime
@@ -513,18 +581,30 @@
513 581
   \renewcommand<>{\TaskArrival}[3][nocommand=1]{
514 582
     \only#4{\beameroriginal{\TaskArrival}[#1]{#2}{#3}}
515 583
   }
584
+  \renewcommand<>{\TaskNArrival}[5][nocommand=1]{
585
+    \only#6{\beameroriginal{\TaskNArrival}[#1]{#2}{#3}{#4}{#5}}
586
+  }
516 587
   \renewcommand<>{\TaskArrDead}[4][nocommand=1]{
517 588
     \only#5{\beameroriginal{\TaskArrDead}[#1]{#2}{#3}{#4}}
518 589
   }
590
+ \renewcommand<>{\TaskNArrDead}[6][nocommand=1]{
591
+    \only#7{\beameroriginal{\TaskNArrDead}[#1]{#2}{#3}{#4}{#5}{#6}}
592
+  }
519 593
   \renewcommand<>{\TaskDeadline}[3][nocommand=1]{
520 594
     \only#4{\beameroriginal{\TaskDeadline}[#1]{#2}{#3}}
521 595
   }
596
+  \renewcommand<>{\TaskNDeadline}[5][nocommand=1]{
597
+    \only#6{\beameroriginal{\TaskNDeadline}[#1]{#2}{#3}{#4}{#5}}
598
+  }
522 599
   \renewcommand<>{\TaskExecution}[4][nocommand=1]{
523 600
     \only#5{\beameroriginal{\TaskExecution}[#1]{#2}{#3}{#4}}
524 601
   }
525 602
   \renewcommand<>{\TaskExecDelta}[4][nocommand=1]{
526 603
     \only#5{\beameroriginal{\TaskExecDelta}[#1]{#2}{#3}{#4}}
527 604
   }
605
+  \renewcommand<>{\TaskNExecDelta}[6][nocommand=1]{
606
+    \only#7{\beameroriginal{\TaskNExecDelta}[#1]{#2}{#3}{#4}{#5}{#6}}
607
+  }
528 608
   \renewcommand<>{\TaskRespTime}[4][nocommand=1]{
529 609
     \only#5{\beameroriginal{\TaskRespTime}[#1]{#2}{#3}{#4}}
530 610
   }
@@ -554,3 +634,4 @@
554 634
 
555 635
 \endinput
556 636
 
637
+

Loading…
Annulla
Salva