03.01.2015 Views

a multi-objective bisexual reproduction genetic algorithm for ...

a multi-objective bisexual reproduction genetic algorithm for ...

a multi-objective bisexual reproduction genetic algorithm for ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

46<br />

A population is a list of n chromosomes. Starting with an empty population, one<br />

after another we create and add new random chromosomes into this population.<br />

A pseudo code <strong>for</strong> creating this is given in Figure 3-12.<br />

For each course<br />

n= number of time-slots needed <strong>for</strong> this class (= number of credits)<br />

Repeat<br />

Randomly select a classroom in list of classrooms that are permissible <strong>for</strong> this course<br />

Search n free time-slots in the chosen classroom<br />

If (n free time-slots are found)<br />

Book the current course to these time-slots<br />

Until (course is booked)<br />

FIGURE 3-12 Pseudo code <strong>for</strong> creating a random chromosome<br />

3.6.4 Evaluating Fitness Function<br />

As represented above, each chromosome x has a fitness value f(x). In this<br />

section, we discuss how to find f(x).<br />

Assume that we have m hard constraints. Let Hc i denote the number of<br />

conflicted hard constraints i, where i = 1..m. Each hard constraints i is assigned a<br />

penalty cost Penalty_hc i . We use f 1 (x) to denote the fitness value of hard constraints.<br />

1<br />

f1(<br />

x)<br />

= Eq. 3-1<br />

m<br />

1+<br />

Hc Penalty _ hc<br />

∑<br />

i=<br />

1<br />

i<br />

Similarly assume that we have n soft constraints. Let Sc j denote the number of<br />

conflicted soft constraints j, where j = 0..n. Each soft constraint j is assigned a penalty<br />

cost Penalty_sc j . We use f 2 (x) to denote the fitness value of soft constraints.<br />

∑<br />

j=<br />

1<br />

j<br />

sc j<br />

i<br />

1<br />

f<br />

2<br />

( x)<br />

= Eq. 3-2<br />

n<br />

1+<br />

Sc Penalty _<br />

Thus, if a chromosome has a lower number of conflicts, f 1 (x) and f 2 (x) will have<br />

a higher fitness value. We use f(x) to denote the fitness value of the chromosome x.<br />

f ( x)<br />

= W ( ) ( )<br />

Eq. 3-3<br />

1<br />

f1<br />

x + W2<br />

f<br />

2<br />

x

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!