Copyright © 2013 IJECCE, All right reserved
Bicriteria Continuous Tasks Scheduling Using Genetic
Algorithm
Myungryun Yoo
Abstract – Real-time systems are characterized by computational activities with timing constraints and classified into two categories: hard real-time systems and soft real-time systems. In hard real-time systems, missing deadlines can be catastrophic. However, in the case of soft real-time systems, slight violence of deadlines is not so critical. In multimedia systems, especially, continuous media is one of typical task scheduling of soft real-time systems.
In this paper, we propose a new real-time tasks scheduling algorithm using Proportion-based Genetic Algorithm
(pp-GA). Especially continuous tasks are considered on
uniprocessor soft real-time environment. The objective of proposed scheduling algorithm is to minimize the variance of deadline missing and the total number of context switch among tasks. For these objectives, this paper combines Adaptive Weight Approach (AWA) that utilizes some useful information from the current population to readjust weights for obtaining a search pressure toward a positive ideal point. The effectiveness of the proposed algorithm is shown through a simulation study.In simulation studies, the results of proposed algorithm show better than that of other algorithms.
Keywords – Soft Real-Time Task, Continuous Task, Genetic Algorithm, Deadline Miss, Context Switch.
I. I
NTRODUCTIONMultimedia systems combine various information sources, such as audio, video, text, graphics and image, into the wide range of application [1]. Video and audio data are referred to as continuous media due to their real-time delivery requirements, whereas text, graphics and image data are referred to as discrete media. Since continuous media are displayed within a certain time constraint, their computation and manipulation of continuous media should be handled under more limited conditions than that of discrete media. For example, continuous media should complete computation before their predetermined deadlines [2].
Real-time systems are characterized by computational activities with timing constraints and classified into two categories: hard real-time systems and soft real-time systems. In hard real-time systems, the violation of timing constraintsof certain tasksshouldnot be acceptable [3]. The consequences of not executing a task before its deadline may lead to catastrophic consequences in certain environments i.e., in patient monitoring systems, nuclear plant control, etc. On the other hand, in soft real-time systems, usefulness of results produced by a task decreases over time after the deadline expires without causing any damage to the controlled environment[4]. The continuous media of multimedia systems is one of typical task scheduling of soft real-time systems.
Traditionally, the performance criterion of scheduling algorithms is throughput, utilization of processor, waiting
time of tasks, etc. In hard real-time systems, the performance of scheduling algorithms is measured by their ability to generate a feasible schedule for a set of real-time tasks. If all the tasks start after their release time and complete before their deadlines, the scheduling algorithm is feasible. Typically, there is Rate Monotonic (RM) and Earliest Deadline First (EDF) derived scheduling algorithms for hard real-time systems[5], [6]. They guarantee the optimality in somewhat restricted environments. RM scheduling algorithm assigns static priority to the tasks such that tasks with shorter periods get higher priorities. And EDF scheduling algorithm is a dynamic algorithm which schedules the task with the earliest deadline first. There are several RM and EDF derived algorithms for soft real-time systems. However, these algorithms have some drawbacks to cope with continuous tasks in soft real-time systems related resource utilization and pattern of degradation under the overloaded situation. Firstly, in continuous tasks, it is not necessary for every instance of a repetitive task to meet its deadline. For soft real-time systems, slight violence of time limits is not so critical. Secondly, RM and EDF scheduling algorithms require strict admission control to prevent unpredictable behaviours when overload situations occur. The strict admission control may cause low utilization of resources[7].
Relatively new research based on stride scheduler underlying proportional share mechanisms is introduced. They are designed to guarantee the fairness of resource allocation and predictability. Rate Regulating Proportional Share (rrPS) scheduling algorithm based on stride scheduler is proposed for continuous task in soft real-time systems. In this research, to specify timing requirements of continuous tasks, the task’s period and the computation time are reflected. The key concept of rrPS scheduling algorithm is a rate regulator which prevents tasks from receiving more resources than its share in a given period. However, rrPS scheduling algorithm does not take account of graceful degradation of performance under the overloaded condition and has the possibility of avoidable context switching overhead[8].
Recently, Modified Proportional Share (mPS) Scheduling algorithm was designed for continuous tasksin soft real-time systems by authors [9]. The mPS scheduling algorithm shows better performance than rrPS scheduling algorithm for graceful degradation of performance under overloaded conditions and fewer context switching. However, computational burden and solution accuracy of mPS could be improved by new algorithm based on Genetic Algorithm(GA).
Copyright © 2013 IJECCE, All right reserved that are periodic and pre-emptive. The objective of
proposed scheduling algorithm is to minimize the variance of deadline missing and the total number of context switching among tasks. For these objectives, this paper combines Adaptive Weight Approach (AWA) that utilizes some useful information from the current population to readjust weights for obtaining a search pressure toward a positive ideal point. Some drawbacks (i.e. low resource utilization and avoidable context switching overhead) of RM and EDF derived algorithms for soft real-time systems could be fixed in proposed algorithm. We take advantage not only of traditional approaches but plus side of GA such as high speed, parallel searching and high adaptability. The rest of the paper is organized as follows: In Section 2, we propose the continuous tasks scheduling problem in soft real-time systems. In Section 3, the problem is mathematically formulated. Section 4 introduces the GA methods and describes implementations used for this problem. Then, the experimental results are illustrated and analysed in Section 5. Finally, Section 6 provides discussion and suggestions for further work on this problem.
II. C
ONTINUOUST
ASKS
CHEDULINGP
ROBLEM INS
OFTR
EAL-T
IMES
YSTEMIn this study, the continuous task scheduling problem is defined as to determine the execution schedule of continuous media tasks with minimizing the variance of deadline missing and the total number of context switch among tasks under the following conditions:
1) All tasks are periodic.
2) All tasks are assigned to same processor (uniprocessor system)
3) All tasks are pre-emptive.
4) Only processing requirements are significant; memory, I/O and other resource requirements arenegligible.
5) All tasks are independent. This means that there areno precedence constraints.
6) The deadline of a task is equal to its period. 7) System is soft real-time system.
A task may be periodic, sporadic, or aperiodic. If task needs to be cyclically executed at constant activation rates, the task is periodic. Sporadic tasks are not periodic, but may be invoked at irregular intervals and aperiodic tasks are not periodic and have no upper bound on their invocation rate[10].
Periodic tasks are characterized by their period and computation time. We focused on continuous media. Fig. 1 represents characteristics of periodic tasks. Where, i is the task index, j is the index of jthexecuted task, τiis ith task, ci is the computation time of taskτi, piis the period of taskτiand dijis jthdeadline of taskτi.
In hard real-time systems, these periodic tasks must finish their computations before their deadlines. However, since we focused in soft real-time systems, slight violence of deadlines could be admitted. If a task cannot be finished until its next invocation, it is considered as a deadline missing.
Fig.1. Characteristics of continuous tasks
III. M
ATHEMATICALM
ODELThe problem is formulated under the following assumption: Computation time and period of each task is known as priori. A time unit is artificial time unit and the context switch overheads among tasks are all same. We present task constraints and system constraints separately for simplicity.
A. Task constraints
Continuous task can be formulated as follows:
N i
T p c γ
i i
i , 1,2,..., (1)
i i
ij
ij r p i N j n
d , 1,2,..., , 1,2,..., (2)
i n j
d
j r
i ij
ij
, ,..., 3 , 2 ,
1 ,
0
1
(3)
j i j i
r r f
s
sij ij ij i i ij ij
, , ,
τ
priority
τ
( priority
, if ) ( )and (4)
where
N : total number of tasks
T : scheduled time
ni : total number of executed taskτi
rij : jthrelease time of taskτi
sij :jthstart time of taskτi
fij : jthfinish time of taskτi
γi : proportional amount of processor service time for taskτi
i' : task index, i'≠i, i'=1,2,…,N
j' : index of j'thexecuted taskτi, j'=1,2,…,ni priority(τi): priority of taskτi
Equation (1) means that all tasks havetheir share for processor service time based on their period and computation time. Equation (2) means that the deadline of a task is equal to its period. All tasks are cyclically executed at constant activation rates as their periods. The release time of the task is defined in (3). In the first stage, the release time of the task is 0. From the next stage, the release time of jthexecuted tasks is equal to the deadline of
j-1thexecuted task. Equation (4) means that all tasks are pre-emptive. If the processor is currently occupied by a task and a higher priority task is invoked at the moment, the higher priority task will occupy the processor immediately.
B. System constraints
Soft real-time systems with uniprocessors in this paper can be formulated as follows:
t x
N
i
it
, 1 0
1
(5)
otherwise if
, 0
,
1 i
d
r t
it ij
c x y
ij
ij
(6) periodpi
computation timeci
deadlinedij deadlinedij+1
periodpi
computation timeci task
periodpi
computation ci
deadlinedij deadline
periodpi
computation ci i
τ
periodpi
computation timeci
deadlinedij deadlinedij+1
periodpi
computation timeci task
periodpi
computation ci
deadlinedij deadline
periodpi
computation ci i
Copyright © 2013 IJECCE, All right reserved where
t : time index, t=1,2,…,T
yij : occurrence of deadline missing at jth executed time of taskτi
otherwise ,
0
time in processor to
assigned is
if ,
1 τ t
x i
it (7)
In (5), the total number of assigned tasks in time t is 1 or 0. It means that all tasks are assigned to same processor. In other words, the system is a uniprocessor system. Equation (6) means the system is a soft real-time system and slight violence of deadlines could be admitted. The value yij=1 means that serviced time of a task during one period is smaller than its computation time and that is deadline missing.
C. Objective function
The problem of scheduling for continuous tasks is to determine the execution sequence of tasks with the objective of minimizing the variance of deadline missing and the total number of context switch among tasks.
2 1
min f σm (8)
T n
f2 s
min (9)
where
ns : total number of context switch
mi : average deadline missing ofτi
ni
j ij i
i y i N
n m
1
,..., 2 , 1 , 1
(10)
m
: average ofm
iN i
m N m
N
i
i, 1,2,...
1
1
(11) σm2 : variance of mi
m m
i NN N
i i
m , 1,2,...,
1
σ
1
2
2
(12)
IV. S
UBSTANTIALC
OMPONENTS OFGA
In this paper, several new techniques are proposed in the encoding and decoding algorithm of genetic string and the genetic operations are introduced for discussion. They are explained in the following subsections.
A. Encoding and decoding
A chromosome Vk={vt}, k=1,2,…,popSize, represents tasks which are assigned to a processor and tth gene vt represents the task which is assigned to a processor in time
t. Where popSize is total number of chromosomes in each
generation. The length of a chromosome is T. It means the minimum term of scheduling. Fig. 2 represents the structure of chromosomes for proposed genetic algorithm. For example, task 1 is executed from time 0 to time 1 in Fig.2.
Fig.2. Chromosome representation
Encoding and decoding procedures can be explained as:
Procedure 1: Proportion-based encoding
step 1: Calculateγiandγs.γsis total sum ofγi. step 2: Calculate qi. qiis the cumulative rate of share
for processor service time and (13).
i N
γ γ q
i γ
γ
q
s i i
s i
i
,..., 3 , 2 ,
1 ,
1
(13)
step 3: Generate a random number r from range [0..1]. if r≤q1then assign 1 to vt, else qi-1< r≤qi,
i=2,3,…,N, then assign i to vt.
step 4: Increase t by 1 and repeat steps 3-4 until t = T.
Procedure 2: Proportion-based decoding
step 1: Derive xitfrom Vk.
step 2: Calculate nijc. nijcis serviced time of taskτifrom
rijto dij.
step 3: If nijc>cithen regulate service time by changing the value 1 of randomly selected locus to 0. step 4: If nijc<cithen assign i to processor in idle time. step 5: Generate schedule by appending task number i
with value 1 at time t.
B. Evaluation function and selection
The multi-objective optimization problems have been receiving growing interest from researchers with various backgrounds since early 1960. Recently, GAs have been received considerable attention as a novel approach to multi-objective optimization problems, resulting in a fresh body of research and applications known as genetic multi-objective optimizations [11], [12].
In this paper, we combine Adaptive Weight Approach (AWA) [13] that utilizes some useful information from the current population to readjust weights for obtaining a search pressure toward a positive ideal point. The fitness value based on AWA can be calculated as follows:
Procedure 3: Adaptive Weight Approach
step 1: Define two extreme points: the maximum extreme point f+and the minimum extreme point
f-in criteria space as follows:
} , { }
,
{f1max f2max f f1min f2min
f (14)
where f1max, f2max, f1minand f2minare the maximal
value and minimal value for objective 1 and objective 2 in the current population.
step 2: The adaptive weight for objective 1 andobjective 2 are calculated by the following (15), (16):
min 1 max 1 1
1
f f w
(15)
min 2 max 2 2
1
f f w
(16)
step 3: Calculate the fitness value for each individual.
popSize k f w f w V
eval k
1 ,
) (
2 2 1 1
(17)
The selection is the main method for GA mimics evolution in natural systems: the fitter an individual is, the highest is its probability to be selected. The common
1 1 1 2 3 3 2 1 schedule
chromosome
0 1 2 3 4 5 6 7 8
T 1
τ τ2 τ3 τ2 τ1
1 1 1 2 3 3 2
1 2 3 3 2 1 1 1
1 schedule
chromosome
0 1 2 3 4 5 6 7 8
T 1
Copyright © 2013 IJECCE, All right reserved strategy called roulette wheel selection [14], [15] has been
used.
C. Genetic operators
We propose Period Unit Crossover (PUX). This operator creates two new chromosomes (the offspring) by mating two chromosomes (the parents), which are combined as shown Fig. 3: the period (from rij to dij) is selected by i, j randomly chosen, and each offspring chromosomes are built by exchanging the substrings of selected period between parents. V'1 and V'2 mean
offspring 1 and offspring 2 each other. The procedure of PUX will be follows as:
Procedure 4: Period Unit Crossover (PUX)
step 1: Generate random number i from range [1..N] and j from range [1..ni].
step 2: Exchange substrings of period (from rijto dij) between parents.
Fig.3. Period unit crossover (PUX).
Fig.4. Altering mutation.
The purpose of mutation is a little change in chromosome. We use the classical one-bit altering mutation [10], [14]. Fig. 4 illustrates this mutation operator. Where V' means offspring.
The procedure will be written as follows:
Procedure 5: Altering Mutation
step 1: Generate random number i from range [1..N], t from range [1..T].
step 2: Exchange the value of vtto i.
V. N
UMERICALR
ESULTSFor the validation of Proportion-based GA (pp-GA), several numerical tests are performed. We compared pp-GA with EDF and mPS scheduling algorithms.
EDF scheduling algorithm is a dynamic algorithm which schedules the task with the earliest deadline first and guarantees the optimality in hard real-time systems.
mPS Scheduling algorithm is designed for soft real-time systems by the author.
Parameters in pp-GA are used as that popSize is 30, crossover probabilitypC is 0.7, mutation probabilitypM is 0.3 and the total number of generationmaxGen is 3000.
Numerical tests are performed with randomly generated three task sets: small scale (total number of tasks 3), medium scale (total number of tasks 10) and large scale (total number of tasks 30). Random tasks have been used by several researchers in the past [14]. Table 1 represents the results of numerical test with the task set 1,2 and 3 in the variance of deadline missing. Table 2 represents the results of numerical test with the task set 1,2 and 3 in the total number of context switch among tasks.
Table 1: Comparison with results of scheduling algorithms for f1(deadline missing).
Task set f1
EDF mPS pp-GA
1 0.145 0.097 0.008
2 0.270 0.130 0.050
3 0.187 0.108 0.020
Table 2: Comparison with results of scheduling algorithms for f2(context switch).
Task set f2
EDF mPS pp-GA
1 0.730 0.557 0.530
2 0.885 0.760 0.760
3 0.970 0.930 0.830
Numerical results show that the proposed pp-GA is better than other algorithms.
Fig. 5 shows all Pareto optimal solutions in task set 1, 2 and 3. In these Figure, the Pareto solution curve by proposed pp-GA is nearby ideal point. The coordinate of ideal point is deadline missing (f1=0) and context
switch(f2=0).
(a) Pareto solution in task set 1
(b) Pareto solution in task set 2
2 1 2 1 2 1 3 1 3 1 3 1 1 3 3 3 1 2 2 1 offspring 1 V 2 V 2 1 1 3 2 1 3 1 3 1 3 1 2 1 3 3 1 2 2 1 V1 V2 4 1 3 3 2 2 6 2 1 pi ci i
i= 2, j= 3
r23= 6
d23= 9
r23 d23
2 1 2 1 2 1 3 1 3 1 3 1 1 3 3 3 1 2 2 1 offspring 1 V 2 V 2 1 1 3 2 1 3 1 3 1 3 1 2 1 3 3 1 2 2 1 parents V1 V2 4 1 3 3 2 2 6 2 1 pi ci i
i= 2, j= 3
r23= 6
d23= 9
r23 d23
2 1 2 1 2 1 3 1 3 1 3 1 1 3 3 3 1 2 2 1 offspring 1
V1
V
2
V2
V 2 1 1 3 2 1 3 1 3 1 3 1 2 1 3 3 1 2 2 1 V1 V2 4 1 3 3 2 2 6 2 1 pi ci i
i= 2, j= 3
r23= 6
d23= 9
r23 d23
2 1 2 1 2 1 3 1 3 1 3 1 1 3 3 3 1 2 2 1 offspring 1
V1
V
2
V2
V 2 1 1 3 2 1 3 1 3 1 3 1 2 1 3 3 1 2 2 1 parents V1 V2 4 1 3 3 2 2 6 2 1 pi ci i
i= 2, j= 3
r23= 6
d23= 9
r23 d23
2 1 1 3 2 1 3 1 3 1 2 1 1 3 3 1 3 1 3 1 V 2 1 1 3 2 1 3 1 3 1
V 1 3 1 3 1 2 3 1 1 2
2 1 1 3 3 1 3 1 3 1 parent offspring V 2 1 1 3 2 1 3 1 3
1 3 1 3 1 2 3 1 1 2
1 2 1 1 3 3 1 3 1 3 1 V 2 1 1 3 2 1 3 1 3 1
V 1 3 1 3 1 2 3 1 1 2
2 1 1 3 3 1 3 1 3 1 parent offspring V 2 1 1 3 2 1 3 1 3 1 0.52 0.54 0.56 0.58 0.6 0.62 0.64
0.00E+00 2.00E-03 4.00E-03 6.00E-03 8.00E-03 1.00E-02 variance of deadline missing
c o n t e x t s w i t c h i n g 0.76 0.77 0.78 0.79 0.8 0.81 0.82 0.83 0.84
0.03 0.035 0.04 0.045 0.05 0.055
variance of deadline m issing
Copyright © 2013 IJECCE, All right reserved (c) Pareto solution in task set 3
Fig.5. The results of bicriteria objective with different task sets
VI. C
ONCLUSIONSA new tasks scheduling algorithm pp-GA is proposed in this paper. The proposed algorithm uses GA and is designed for continuous media in soft real-time systems. In soft real-time systems, deadline missing can be allowed. pp-GA is to determine execution sequence of tasks with the objective of minimizing the variance of deadline missing and the total number of context switching among tasks. For ensuring the population diversity in multi-objective optimization problem, Adaptive Weight Approach (AWA) which is one of weighted-sum approach, was adopted. Their elements represent that weights are adjusted adaptively based on the current generation to obtain search pressure toward the positive ideal point.From the numerical results, the results of the pp-GA are better than EDF and mPS scheduling algorithms. Also, the results of the pp-GA show all Pareto optimal solution. This determines the next step of our study. We plan to design tasks scheduling algorithm in multiprocessor soft real-time systems using proportion-based GA and to design tasks scheduling algorithm in hard real-time systems.
R
EFERENCES[1] M. S. Chen, “Stream Conversion to Support Interactive Video Playout,” inProc. of IEEE multimedia, 1996, pp. 51-58.
[2] P. J. Tsun and H. Babak, “Dynamic real time scheduling strategies for interative continuous media servers,”Multimedia Systems, vo. 7, no. 1, 1999, pp. 91-95.
[3] K. Zhu, Y. Zhuang and Y. Viniotis, “Achieving End-to-End Delay Bounds by EDF Scheduling without Traffic Shaping,” in Proc. of 20th Annual Joint Conference on the IEEE Communications Societies,2001, pp. 1493-1501.
[4] C. M. Krishna and G. S. Kang, Real-Time System, McGraw-Hill, 1997.
[5] J. L. Diaz, D. F. Garcia and J. M. Lopez, “Minimum and
Maximum Utilization Bounds for Multiprocessor Rate
Monotonic Scheduling,” IEEE Transactions on Parallel and Distributed Systems,vol. 15, no. 7, 2004, pp. 642-653.
[6] G. Bernat, A. Burns and A. Liamosi, “Weakly Hard Real-Time
Systems,”Transactions on Computer Systems, vol. 50, no. 4, :
2001, pp. 308-321.
[7] M. R. Yoo, A Scheduling Algorithm for Multimedia Process, Ph.D. dissertation, University of YeoungNam, Korea, 2002.
[8] M. H. Kim, H. G. Lee and J. W. Lee, “A Proportional-Share
Scheduler for Multimedia Applications,” inProc. of Multimedia Computing and Systems, 1997, pp. 484-491.
[9] M. R. Yoo, B. C. Ahn, D. H. Lee and H. C. Kim, “A New Real
-Time Scheduling Algorithm for Continuous Media Tasks,” in Proc. of Computers and Signal Processing, 2001, pp. 26-28.
[10] L. E. Jackson and G. N. Rouskas, “Optimal Quantization of Periodic Task Requests on Multiple Identical Processors,”IEEE Transactions on Parallel and Distributed Systems, vol. 14, no. 8,
2003, pp. 795-806.
[11] K. Deb, Multi-objective Optimization using Evolutionary Algorithms, John Wiley & Sons, 2001.
[12] N. G. Sancho, “A multi-objective routing problem,”Engineering Optimization, vol. 10, 1986, pp. 71-76.
[13] M. Gen and R. Cheng, Genetic Algorithms & Engineering
Optimization, John Wiley & Sons, 2000.
[14] Y. Monnier, J. P. Beauvais and A. M. Deplanche, “A Genetic Algorithm for Scheduling Tasks in a Real-Time Distributed System,” inProc. of 24th Euromicro Conference, 1998, pp.
708-714.
[15] M. Gen and R. Cheng, Genetic Algorithms & Engineering
Design, John Wiley & Sons, 1997.
A
UTHOR’
SP
ROFILEMyungryun Yoo
received B.E from Andong National University, Korea in 1994, M.S from PohangUniversity of science & Technology, Korea in 1996and the first Ph.D. degree from YeoungNam University, Koreain 2002. Shereceived the second Ph.D. degree from Graduate School ofInformation, Production & Systems, WasedaUniversity, Japan in 2006. She joined Tokyo CityUniversity as Associate Professor in 2006. Her research field is Real-TimeSystem, Scheduling, Multimedia System, etc.
E-mail: [email protected]
0.82 0.84 0.86 0.88 0.9 0.92 0.94 0.96 0.98
0.005 0.01 0.015 0.02 0.025
variance of deadline missing
c
o
n
t
e
x
t
s
w
i
t
c
h
i
n