• Aucun résultat trouvé

The TRO Codification Schema

A New Chromosome Codification for Scheduling Problems

6.4 The TRO Codification Schema

In principle, a chromosome is represented by a Resource Matrix (RM). This is an m×nmatrix where the jth row represents a partial schedule for the tasks requiring the resource Rj. From a RM a schedule can be built by merging all of the partial schedules so that every precedence constraint is also satisfied. Unfortunately, sometimes this is not possible because of the lack of compatibility among partial schedules and hence a number of them should be modified. In order to do that, we take up a priority schema for resources so that partial schedules of low-priority re-sources are modified first. To represent priorities we include into the chromosome representation a Resource Priority vector (RP) that codifies a resource ordering, from high to low rescheduling priority. Figure 6.4a shows an RMrepresenting par-tial schedules for the problem of Figure 6.1, and Figure 6.4 b shows an RPof pri-orities among resources.

The genetic operators we have used in this work are a natural extension of the former GPX and OX. Given two chromosomes we first apply the GPX operator to the pair composed by the ithrow of each RM component, and then to the pair of RP components. At the same time, the OX operator is applied to the RP component and to every row of the RM component of the offspring. Nevertheless, the design of ge-netic operators allows other possibilities, for example we could exploit any heuristic information about either promising partial schedules or criticality measures of the resources as an alternative choice of making random crossovers and mutations.

To evaluate chromosomes we have envisaged a scheduling algorithm that is a variant of the well-known G&T algorithm proposed in [5] and used, for example, in [8]. The G&T algorithm selects nondeterministically the next task to be scheduled.

We solve this nondeterminism by taking into account partial schedules of resources, as expressed in the MRcomponent and the priorities among resources expressed in theRP. The algorithm tries to preserve the partial orderings of resources with high-est priority at the cost of breaking the partial schedules of lower-priority ones. The rationale behind this strategy is that the priority of a resource is a measure of the re-liance on its partial schedule.

Figure 6.5 shows the scheduling algorithm. This algorithm is a variant of the well-known G&T algorithm proposed by Giffler and Thomson in [5]. The main dif-ference is the way of selecting the task tevat the beginning. In the G&T algorithm this task is selected as the one with the lowest completion time possible in case it was scheduled next. By working in this way, the G&T algorithm constrains the search to the subset of active schedules, i.e. no matter how the task e* is finally selected from the set B, the resulting schedule is active.A schedule is active if it is not possible to change the starting of a task toward a lower time, without delaying another one, requiring in consequence swapping the relative ordering of at least two tasks. Constraining the search to the set of active schedules is, in principle, a good idea because it is proved that there is at least an optimal solution belonging to this set. Even though our proposed algorithm does not constrain the search to the set of active schedules, we have obtained experimental results a little bit better than the results obtained with the genuine G&T algorithm.

The algorithm that selects the task e*from the set B to be scheduled next needs some more explanations. This algorithm tries to maintain the partial schedules as expressed in the rows of the matrix RM. Therefore, if the set B contains a number of tasks whose ancestors in the partial schedule have been already selected

BETR& ’

( )

, one of these task is scheduled next. Moreover, ties are broken in fa-vor of the most critical resources in order to give a higher chance of maintaining their partial schedules on further selections. On the other hand, when the set B does not contain any task whose precedents in the row of matrix RM were already se-lected

(

BETR

)

at least a partial schedule must be broken. In this situation, the algorithm tries to select the task in B belonging to the same job as the task in the set

´

a.The Resource Matrix (RM) component b. The vector of Resource Priorities (RP) component

Figure 6.4. A TRO codification chromosome for the problem of Figure 6.1.

TB that requires the most critical resource, hence giving a chance to maintain the partial schedule of this resource. Finally if there is not any task in the set BETB with the same resource requirement, the task of Brequiring the lowest-priority re-source is selected, therefore breaking its partial schedule.

S c h e d u lin g a lg o r it h m

A = { t 0 1 ,. .. ,t 0 ( m- 1 ) } ; / * fir st ta sk o f e ac h o f th e j o b s, at e ach s tep A i s t h e se t o f u n sch ed u l ed ta sk s w h o se p r ec ede n t s i n th e j o b ar e sc h ed u l ed * / w h il e A& ’d o {

D e te rmin eev D As u c h th a t tev )te,™ De A, w h er e te i s th e l o w est s ta rt ti m e if ta sk e w as s ch e d u led n ex t;

L e t M ’ b e t h e m a ch in e r eq u ir ed b y ev, an d B t h e su b s et o f t ask s in A req u ir in g M ’;

D e le te fr o m B th o s e t as k s th at ca n n o t st ar t a t a t im e lo w er th an tev+duev; S e le ct e*f ro m B to b e sch ed u le d n e x t;

D e le te e* f ro m A a n d in se rt th e n ex t ta sk o f th e sa m e jo b a s e*i f e*i s n o t t h e la st o n e o f it s jo b ;

} en d .

Algorithm to Selecte* from B

T R = s et o f u n sc h e d u l ed ta sk s su c h th a t al l t h e ir p r ec ed e n t s i n th e c o r res p o n d in g r o w o f R M ar e alrea d y sc h e d u le d ;

if

(

BETR& ’

)

th en e*= ta sk o f BETR re q u ir in g t h e m o st cr it ica l re so u rc e, i. e, t h e o n e w it h h ig h e st p ri o r ity i n R P ;

el se JB = s et o f jo b s t o w h i ch th e tas k s o f B b elo n g s;

T R B = su b se t o f ta sk s o f T R b e lo n g i n g to a jo b o f JB ; if

(

TRB& ’

)

th en R * = se t o f re so u rc es re q u ir ed b y th e ta sk s o f T R B ;

e= ta sk o f T R B re q u iri n g to t h e m o st cr it ic al reso u r ce o f R * ( se e R P ) ; J * = j o b c o n t ai n in g th e t as k e;

e*= t as k o f B b el o n g in g to J* ;

el se e* = t as k o f B r eq u i rin g th e l ea st cr iti ca l res o u rce ( se e R P ) ; en d .

Figure 6.5. Scheduling algorithm. te refers to the start time of task e and dueto its proc-essing time.