3.2 Chromosomes
In our work, we encode the solution to the problem
into a chromosome to specify a GA and as conse-
quence, we define/implement the crossover operator
and the tabu search algorithm against the mutation op-
erator on the works of authors in (BLS06).
To optimize the problem, we will optimize the ar-
rival times of all sporadic and aperiodic tasks of all
the genes composing the chromosome. A gene can
be depicted as a pair of character and integer values
(τ
i
, a
i, j
); that is a sporadic or aperiodic task symbol
and an arrival time. The chromosome’s size which is
the number of genes was defined as the total number
of executions of all sporadic and aperiodic tasks. The
length of the chromosome is l =
∑
h
i=1
l
H
min
i
m
, where
h is the number of sporadic and aperiodic tasks and
k
i
=
l
H
min
i
m
is the maximum number of executions for
sporadic/aperiodic task τ
i
over an hyper-period H. As
defined by (BLS06), to depict a non-existent arrival
time, we use a special value: -1. To handle the con-
straints of the genes of the chromosome, we need a
good design. These constraints are defined by two
consecutive arrival times for a particular event which
must have a difference of at least the minimum inter-
arrival time, and at most the maximum inter-arrival
time if it exists, else, it is set to H. Also, in order to
facilitate chromosome manipulations, all genes corre-
sponding to the same task τ
i
are grouped together and
ordered increasingly in a linked list Link
i
according to
a
i, j
. For example, given a set of 3 aperiodic tasks τ
1
(min
τ
1
= 6); τ
2
(min
τ
2
= 9) and τ
3
(min
τ
3
= 12). We
consider the following chromosome (τ
1
, -1) (τ
1
, 10)
(τ
1
, 16) (τ
2
, 11) (τ
2
, 20) (τ
3
, 12) (τ
3
, 25) (τ
3
, 37) as
a valid chromosome in a time interval (hyper-period)
H = [ζ, 2∗ LCM + ζ]; with ζ = 0 and lcm of (6, 9, 12)
= 36, i.e., H = [0,72]. In contrast, the following chro-
mosome (τ
1
, -1) (τ
1
, 10) (τ
1
, 16) (τ
2
, 11) (τ
2
, 20)
(τ
3
, 12) (τ
3
, 25) (τ
3
, 31) is not valid since the mini-
mum inter-arrival time of the third task is not satisfied
by the two last genes.
3.3 Initialization
We randomly generate the initial population at first
with respect to the constraints mentioned above. Af-
ter that, we find the hyper-period H based on the lcm
of all periods of tasks τ
i
. The authors in (BLS06)
used a value T as a maximum of the time inter-
val but we use in our work the hyper-period H. The
value of a
i, j
is randomly selected from a range deter-
mined by the arrival time of a
i, j−1
as well as min
i
and
max
i
. If max
i
is not specified, its value is set to H:
[a
i, j−1
+ min
i
, a
i, j−1
+ max
i
]. Also, if there is no pre-
vious gene (i.e., j = 1), or the previous gene depicts a
non-existent arrival time (i.e., a
i, j−1
= -1), the range
is [0, max
i
]. After that, the genes are ordered in an
increasing order and putted in a linked list (Link
i
).
3.4 Cross-over
Cross-over and mutation operators are the ways GAs
explore a solution space. Hence, they must be formu-
lated in such a way that they efficiently and exhaus-
tively explore the solution space (LE98).
On the other hand, task of formulating operators
is rather difficult as genetic operators must maintain
allowability. In other words, genetic operators must
be designed in such a way that if a constraint is not
violated by the parents, it will not be violated by the
children resulting from the operations (EEZ94).
In (BLS06), the authors adopt the cross-over and
mutation operators. In contrast, in our original work,
we will adopt cross-over operator and tabu search al-
gorithm on behalf of the mutation operator and we
will test this hybrid approach in order to prove its ef-
ficiency. Indeed, the crossover operator is special in
order to respect the constraint that every task which is
copied didn’t repeated another time in order to respect
the tasks unicity and creates two solutions or childs by
combining two parents (HHS14).
The principle of the crossover operator is to pass
traits from the parents to the two resulting childs (off-
springs) with variety methods. In (M.A), the authors
used the operator crossover called sexual crossover
or n-point crossover. The general idea in n-point
crossover adopted by (M.A) is that the two parent
chromosomes are aligned and cut into n+1 fragments
at the same places to identify the division points. Af-
ter that, two new childrens are created by altering the
genes of the parents. In (BLS06), the authors adopted
the method of creating two new children by inherit-
ing fragments from parents with a 50 % probability
where the division points of the parents depend on K
i
for each task τ
i
. For more details, see (BLS06).
In our work, we adopt another method in order
to have a better solution from generation to another.
Indeed, for each pair of parents (chromosomes), two
crossover integers i
1
and i
2
are randomly generated
with the condition 1≤ i
1
, i
2
≺ h where h is the num-
ber of genes composing the parent chromosome, be-
ing scheduled. In the random position i
1
, the first chil-
dren (child1) inherits i
2
genes from parent
1
(P
1
) and
the second children (child2) inherits i
2
genes from
parent
2
(P
2
). Then, child1 inherits the remaining
genes of P
2
and similarly, child2 inherits the remain-
ing genes of P
1
. Finally, the genes must be ordered
AHybridGeneticbasedApproachforReal-timeReconfigurableSchedulingofOSTasksinUniprocessorEmbedded
Systems
387