Browse Source

package multido removed, add of periodic commands

Antoine Bertout 9 years ago
parent
commit
6d3cb88343
3 changed files with 225 additions and 140 deletions
  1. 8
    8
      rtsched-beamer-doc.tex
  2. 125
    121
      rtsched-doc.tex
  3. 92
    11
      rtsched.sty

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

76
       }
76
       }
77
       \RTBox<23>{6}{10}
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
       % no simple formula for lowest priority, sorry!
88
       % no simple formula for lowest priority, sorry!
89
       \TaskExecution{2}{1}{4}
89
       \TaskExecution{2}{1}{4}
90
       \TaskExecution{2}{6}{8}
90
       \TaskExecution{2}{6}{8}

+ 125
- 121
rtsched-doc.tex View File

2
 
2
 
3
 \usepackage{rtsched}
3
 \usepackage{rtsched}
4
 \usepackage{url}
4
 \usepackage{url}
5
-\usepackage{multido}
6
 
5
 
7
 \title{The \texttt{rtsched} package for \LaTeX \\ (version 2.0)}
6
 \title{The \texttt{rtsched} package for \LaTeX \\ (version 2.0)}
8
 \author{Giuseppe Lipari}
7
 \author{Giuseppe Lipari}
69
 \noindent where \texttt{i} is the task index (from 1 to \texttt{n}
68
 \noindent where \texttt{i} is the task index (from 1 to \texttt{n}
70
 included), \texttt{t} is the arrival time, and \texttt{reld} is the
69
 included), \texttt{t} is the arrival time, and \texttt{reld} is the
71
 relative deadline; an absolute deadline will be drawn at \texttt{t +
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
 In this example there are a lot of repetitions. These can be avoided
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
 To draw the execution rectangle, you can use the following command:
99
 To draw the execution rectangle, you can use the following command:
79
 \begin{verbatim}
100
 \begin{verbatim}
160
 \begin{figure}[!htbp]
181
 \begin{figure}[!htbp]
161
   \centering
182
   \centering
162
   \begin{RTGrid}{2}{20}
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
     % no simple formula for lowest priority, sorry!
192
     % no simple formula for lowest priority, sorry!
173
     \TaskExecution{2}{1}{4}
193
     \TaskExecution{2}{1}{4}
174
     \TaskExecution{2}{6}{8}
194
     \TaskExecution{2}{6}{8}
178
 
198
 
179
 \begin{verbatim}
199
 \begin{verbatim}
180
   \begin{RTGrid}{2}{20}
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
     % no simple formula for lowest priority, sorry!
209
     % no simple formula for lowest priority, sorry!
191
     \TaskExecution{2}{1}{4}
210
     \TaskExecution{2}{1}{4}
192
     \TaskExecution{2}{6}{8}
211
     \TaskExecution{2}{6}{8}
194
     \TaskExecution{2}{13}{16}    
213
     \TaskExecution{2}{13}{16}    
195
   \end{RTGrid}
214
   \end{RTGrid}
196
 \end{verbatim}
215
 \end{verbatim}
197
-  \caption{Using multido to avoid repetitions}
216
+  \caption{Using periodic commands to avoid repetitions}
198
   \label{fig:ex1a}
217
   \label{fig:ex1a}
199
 \end{figure}
218
 \end{figure}
200
 
219
 
201
 \begin{figure}[!htbp]
220
 \begin{figure}[!htbp]
202
   \centering
221
   \centering
203
   \begin{RTGrid}{3}{14}
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
     \TaskExecDelta{2}{4}{1}
232
     \TaskExecDelta{2}{4}{1}
214
     \TaskExecDelta{2}{7}{1}
233
     \TaskExecDelta{2}{7}{1}
215
     \TaskExecDelta{2}{11}{1}
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
     \TaskExecDelta{3}{1}{1}
239
     \TaskExecDelta{3}{1}{1}
221
     \TaskExecDelta{3}{8}{1}
240
     \TaskExecDelta{3}{8}{1}
222
     \TaskExecDelta{3}{12}{1}
241
     \TaskExecDelta{3}{12}{1}
224
 
243
 
225
 \begin{verbatim}
244
 \begin{verbatim}
226
   \begin{RTGrid}{3}{14}
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
     \TaskExecDelta{2}{4}{1}
255
     \TaskExecDelta{2}{4}{1}
236
     \TaskExecDelta{2}{7}{1}
256
     \TaskExecDelta{2}{7}{1}
237
     \TaskExecDelta{2}{11}{1}
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
     \TaskExecDelta{3}{1}{1}
262
     \TaskExecDelta{3}{1}{1}
243
     \TaskExecDelta{3}{8}{1}
263
     \TaskExecDelta{3}{8}{1}
251
 \begin{figure}[!htbp]
271
 \begin{figure}[!htbp]
252
   \centering
272
   \centering
253
   \begin{RTGrid}[width=8cm]{2}{15}
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
   \end{RTGrid}
276
   \end{RTGrid}
259
 \begin{verbatim}
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
 \end{verbatim}
282
 \end{verbatim}
265
   \caption{Deadlines less than periods}
283
   \caption{Deadlines less than periods}
266
   \label{fig:ex1c}
284
   \label{fig:ex1c}
273
 \begin{figure}
291
 \begin{figure}
274
   \centering
292
   \centering
275
   \begin{RTGrid}{2}{20}
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
   \end{RTGrid}  
310
   \end{RTGrid}  
294
 \begin{verbatim}
311
 \begin{verbatim}
295
   \begin{RTGrid}{2}{20}
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
 \end{verbatim}
330
 \end{verbatim}
311
   \caption{Example with TaskRespTime}
331
   \caption{Example with TaskRespTime}
312
   \label{fig:resp-time}
332
   \label{fig:resp-time}
323
   \centering
343
   \centering
324
   %% no grid and no symbols
344
   %% no grid and no symbols
325
   \begin{RTGrid}[nogrid=1,nosymbols=1]{2}{20}
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
     \TaskExecution{2}{1}{4}
349
     \TaskExecution{2}{1}{4}
332
     \TaskExecution{2}{6}{8}
350
     \TaskExecution{2}{6}{8}
333
     \TaskExecution{2}{9}{10}
351
     \TaskExecution{2}{9}{10}
336
 \begin{verbatim}
354
 \begin{verbatim}
337
   %% no grid and no symbols
355
   %% no grid and no symbols
338
   \begin{RTGrid}[nogrid=1,nosymbols=1]{2}{20}
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
     \TaskExecution{2}{1}{4}
360
     \TaskExecution{2}{1}{4}
345
     \TaskExecution{2}{6}{8}
361
     \TaskExecution{2}{6}{8}
346
     \TaskExecution{2}{9}{10}
362
     \TaskExecution{2}{9}{10}
366
   %% specification of the symbol, as the symbol is already used in a
382
   %% specification of the symbol, as the symbol is already used in a
367
   %% math environment inside the macro
383
   %% math environment inside the macro
368
   \begin{RTGrid}[width=8cm,symbol=\gamma,nonumbers=1,labelsize=\small]{2}{20}
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
     %% here, the border changes to cyan, and the fill to white
388
     %% here, the border changes to cyan, and the fill to white
376
     \TaskExecution[linecolor=cyan,color=white]{2}{1}{4}
389
     \TaskExecution[linecolor=cyan,color=white]{2}{1}{4}
377
     %% the next two boxes are filled with red instead of gray
390
     %% the next two boxes are filled with red instead of gray
387
   %% specification of the symbol, as the symbol is already used in a
400
   %% specification of the symbol, as the symbol is already used in a
388
   %% math environment inside the macro
401
   %% math environment inside the macro
389
   \begin{RTGrid}[symbol=\gamma,nonumbers=1,labelsize=\Large]{2}{20}
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
     %% here, the border changes to cyan, and the fill to white
406
     %% here, the border changes to cyan, and the fill to white
397
     \TaskExecution[linecolor=cyan,color=white]{2}{1}{4}
407
     \TaskExecution[linecolor=cyan,color=white]{2}{1}{4}
398
     %% the next two boxes are filled with red instead of gray
408
     %% the next two boxes are filled with red instead of gray
424
     \RowLabel{1}{Server}
434
     \RowLabel{1}{Server}
425
     %% the symbol for the second row
435
     %% the symbol for the second row
426
     \RowLabel{2}{$\Pi_2$}
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
     \TaskExecution{2}{1}{4}
441
     \TaskExecution{2}{1}{4}
434
     \TaskExecution{2}{6}{8}
442
     \TaskExecution{2}{6}{8}
435
     \TaskExecution{2}{9}{10}
443
     \TaskExecution{2}{9}{10}
442
     \RowLabel{1}{Server}
450
     \RowLabel{1}{Server}
443
     %% the symbol for the second row
451
     %% the symbol for the second row
444
     \RowLabel{2}{$\Pi_2$}
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
     \TaskExecution{2}{1}{4}
457
     \TaskExecution{2}{1}{4}
452
     \TaskExecution{2}{6}{8}
458
     \TaskExecution{2}{6}{8}
453
     \TaskExecution{2}{9}{10}
459
     \TaskExecution{2}{9}{10}
505
   \centering
511
   \centering
506
   \begin{RTGrid}{2}{20}
512
   \begin{RTGrid}{2}{20}
507
     \RTBox{12}{16}
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
     \TaskArrival{2}{10}
516
     \TaskArrival{2}{10}
512
     \TaskExecDelta[exeheight=1.5]{2}{10}{3}
517
     \TaskExecDelta[exeheight=1.5]{2}{10}{3}
513
     \Activation{1}{8}{2}{10}
518
     \Activation{1}{8}{2}{10}
516
 \begin{verbatim}
521
 \begin{verbatim}
517
   \begin{RTGrid}{2}{20}
522
   \begin{RTGrid}{2}{20}
518
     \RTBox{12}{16}
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
     \TaskArrival{2}{10}
526
     \TaskArrival{2}{10}
523
     \TaskExecDelta[exeheight=1.5]{2}{10}{3}
527
     \TaskExecDelta[exeheight=1.5]{2}{10}{3}
524
     \Activation{1}{8}{2}{10}
528
     \Activation{1}{8}{2}{10}

+ 92
- 11
rtsched.sty View File

278
     \@RTExecDefaultValues%
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
 \newcommand{\TaskArrival}[3][nocommand=1]{%
286
 \newcommand{\TaskArrival}[3][nocommand=1]{%
285
     \setkeys{RT}{#1}%
287
     \setkeys{RT}{#1}%
286
     \@compute@yy{#2}
288
     \@compute@yy{#2}
289
      \begin{pgfonlayer}{foreground} 
291
      \begin{pgfonlayer}{foreground} 
290
     \draw [\RTLineColor, thick,-\RTArrowStyle] (\xx,\yy) -- (\xx,\yyy);
292
     \draw [\RTLineColor, thick,-\RTArrowStyle] (\xx,\yy) -- (\xx,\yyy);
291
      \end{pgfonlayer}
293
      \end{pgfonlayer}
292
-
293
     \@RTExecDefaultValues%
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
 \newcommand{\TaskArrDead}[4][nocommand=1]{
316
 \newcommand{\TaskArrDead}[4][nocommand=1]{
301
   \setkeys{RT}{#1}%
317
   \setkeys{RT}{#1}%
302
   \@compute@yy{#2}
318
   \@compute@yy{#2}
312
   \@RTExecDefaultValues
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
 \newcommand{\TaskDeadline}[3][nocommand=1]{
351
 \newcommand{\TaskDeadline}[3][nocommand=1]{
320
   \setkeys{RT}{#1}%
352
   \setkeys{RT}{#1}%
321
   \@compute@yy{#2}
353
   \@compute@yy{#2}
327
   \@RTExecDefaultValues
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
 \newcommand{\TaskExecution}[4][nocommand=1]{
381
 \newcommand{\TaskExecution}[4][nocommand=1]{
331
   \setkeys{RT}{#1}%
382
   \setkeys{RT}{#1}%
332
   \@compute@yy{#2}
383
   \@compute@yy{#2}
475
 
526
 
476
 % 
527
 % 
477
 % TaskExecDelta
528
 % TaskExecDelta
529
+% Task execution delta: draws an execution from start time during delta time
478
 % par 1:  task
530
 % par 1:  task
479
 % par 2:  start time
531
 % par 2:  start time
480
 % par 3:  delta
532
 % par 3:  delta
492
   \@RTExecDefaultValues
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
 % TaskRespTime
565
 % TaskRespTime
513
   \renewcommand<>{\TaskArrival}[3][nocommand=1]{
581
   \renewcommand<>{\TaskArrival}[3][nocommand=1]{
514
     \only#4{\beameroriginal{\TaskArrival}[#1]{#2}{#3}}
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
   \renewcommand<>{\TaskArrDead}[4][nocommand=1]{
587
   \renewcommand<>{\TaskArrDead}[4][nocommand=1]{
517
     \only#5{\beameroriginal{\TaskArrDead}[#1]{#2}{#3}{#4}}
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
   \renewcommand<>{\TaskDeadline}[3][nocommand=1]{
593
   \renewcommand<>{\TaskDeadline}[3][nocommand=1]{
520
     \only#4{\beameroriginal{\TaskDeadline}[#1]{#2}{#3}}
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
   \renewcommand<>{\TaskExecution}[4][nocommand=1]{
599
   \renewcommand<>{\TaskExecution}[4][nocommand=1]{
523
     \only#5{\beameroriginal{\TaskExecution}[#1]{#2}{#3}{#4}}
600
     \only#5{\beameroriginal{\TaskExecution}[#1]{#2}{#3}{#4}}
524
   }
601
   }
525
   \renewcommand<>{\TaskExecDelta}[4][nocommand=1]{
602
   \renewcommand<>{\TaskExecDelta}[4][nocommand=1]{
526
     \only#5{\beameroriginal{\TaskExecDelta}[#1]{#2}{#3}{#4}}
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
   \renewcommand<>{\TaskRespTime}[4][nocommand=1]{
608
   \renewcommand<>{\TaskRespTime}[4][nocommand=1]{
529
     \only#5{\beameroriginal{\TaskRespTime}[#1]{#2}{#3}{#4}}
609
     \only#5{\beameroriginal{\TaskRespTime}[#1]{#2}{#3}{#4}}
530
   }
610
   }
554
 
634
 
555
 \endinput
635
 \endinput
556
 
636
 
637
+

Loading…
Cancel
Save