Table of Contents
Task is a basic term in scheduling problems describing a unit of
work to be scheduled. The terminology is adopted from the following
publications: I – [Błażewicz01],
II – [Butazo97], III –
[Liu00]. Graphic representation
of task parameters is shown in Figure 3.1, “Graphics representation of task parameters”.
Task T
j in the toolbox is
described by the following properties:
- Name (
Name
) label of the task
- Processing timeI
pj (
ProcTime
) is the time necessary to execute task
T
j on the processor without interruption(Computation time II)
- Release timeIII
rj (
ReleaseTime
) is the time at which a task becomes ready for execution
(Arrival time I,II, Ready time I, Request time II)
- DeadlineI dj
(
Deadline
) specifies a time limit by which the task has to be completed, otherwise the scheduling is assumed to fail
- Due dateI
d~j
(
DueDate
) specifies a time limit by which the task should be completed, otherwise the criterion function is charged by penalty
- WeightI
(
Weight
) expresses the priority of the task with respect to other tasks (Priority II)
- Processor (
Processor
) specifies dedicated processor on which the task must be executed
Rest of the task properties shown in Figure 3.1, “Graphics representation of task parameters” are related to start
time of task s
j, i.e.
result of scheduling (see sections Section 4.1, “Start Time of Task”
and Section 3.2, “Schedule”). Properties
completion time
C
j
(C
j=s
j+p
j),
waiting time
w
j
(w
j=s
j+r
j),
flow time
F
j
(F
j=C
j-r
j),
lateness L
j
(Lj=C
j+d
j)
and tardiness
D
j
(D
j=max
{C
j-dj,0})
can be derived from start time
s
j.
In the toolbox, task is represented by the object
task
. This object is created by the command with the
following syntax rule (properties contained inside the square brackets are
optional):
t1 = task([Name,]ProcTime[,ReleaseTime[,Deadline[,DueDate [,Weight[,Processor]]]]])
Command task
is a constructor of object
task
and returns the object. In the syntax rule above
the object is the variable t1
. Examples of the object
task creating are shown in Figure 3.2, “Creating task objects”.
>> t1 = task(5) Task "" Processing time: 5 Release time: 0 >> t2 = task('task2',5,3,12) Task "task2" Processing time: 5 Release time: 3 Deadline: 12 >> t3 = task('task3',2,6,18,15,2,2) Task "task3" Processing time: 2 Release time: 6 Deadline: 18 Due date: 15 Weight: 2 Processor: 2
Figure 3.2. Creating task objects
Parameters of a task can be graphically displayed using command
plot
. For example parameters of task
t3
, created above, can be displayed by command:
>> plot(t3)
For more details see Reference Guide @task/plot.m.
Command get
returns the value of the specified
property or values of all properties. Command set
sets the value of the specified property. These two commands has the same
syntax as is described in Matlab user's guide. Property access is allowed
using the . (dot) operator too.
To obtain a list of all accessible properties use command
get
. Note that some private and virtual properties
aren't accessible using the . (dot) operator, although they are
presented when the automatic completion by Tab key is used.
An example of task modification:
>> get(t3) Name: 'task3' ProcTime: 2 ReleaseTime: 6 Deadline: 18 DueDate: 15 Weight: 2 Processor: 2 UserParam: Notes: '' >> set(t3,'ProcTime',4) >> get(t3,'ProcTime') ans = 4
Command add_scht
adds the start time into an
object task. Schedule of a task is described by three arrays
(start
, length
,
processor
). The length of array is equal to number of
task preemptions minus one. Opposite command to get_scht is
appointed for getting a schedule from the task object.
For
more details see Reference Guide @task/add_scht.m ,
@task/get_scht.m.
Commands set_graphic_param
and
get_graphic_param
can be used to define color of
tasks. If color of task is set, command plot
will use it.
Use of these commands is shoved on the following example:
>> t = task('task',5); >> set_graphic_param(t,'color','red') >> get_graphic_param(t,'color') ans = red
Periodic tasks are tasks, which are released periodically with a
fixed period. There is a ptask
object in
TORSCHE™ that allows users to work with periodic
tasks. Periodic tasks are mainly used in real-time scheduling area (see
Chapter 8, Real-Time Scheduling).
The syntax of ptask
constructor
is:
pt = ptask([Name,]ProcTime,Period[,ReleaseTime[,Deadline[,Duedate[,Weight[,Processor]]]]])
Almost all parameters are the same as for task
object except for Period
, which specifies the period
of the task.