Genetic Algorithms
Genetic Algorithms
Genetic Algorithms
Subject Code:PCP7H010
Credit:3-0-0
7th Semester
Branch:ETC
By
Dr. Sakuntala Mahapatra
Dean (R &D), Professor and HOD
Dept. of Electronics & Telecommunication Engg.
TRIDENT ACADEMY OF TECHNOLOGY
BHUBANESWAR, ODISHA
100 0
X1: 16.5%
X2: 20.2%
75.2 X3: 6.4%
X4: 6.4%
X5: 25.3%
36.7 X6: 24.8%
49.5 43.1
1 0 0 0 1 0 1 0 0 0 1 1 1 0 1 1
x y
@ Dr. Sakuntala Mahapatra 26/11/2020 Genetic Algorithms 72
Genetic Algorithms - Fitness Function
Example 3
The next step is to calculate the fitness of each
chromosome. This is done in two stages.
First, a chromosome, that is a string of 16 bits, is
partitioned into two 8-bit strings.
1 0 0 0 1 0 1 0 and 0 0 1 1 1 0 1 1
Then these strings are converted from binary
(base 2) to decimal (base 10).
(10001010 ) 2 1 27 0 26 0 2 5 0 2 4 1 23 0 2 2 1 21 0 2 0 (138)10
and
(00111011) 2 0 2 7 0 2 6 1 25 1 2 4 1 2 3 0 2 2 1 21 1 2 0 (59)10
@ Dr. Sakuntala Mahapatra 26/11/2020 Genetic Algorithms 73
Genetic Algorithms - Fitness Function
Example 3
Now the range of integers that can be handled by
8-bits, that is the range from 0 to (28 - 1), is
mapped to the actual range of parameters x and y,
that is the range from -3 to 3.
6
0.0235294
256 1
To obtain the actual values of x and y, we use the
Formula
x (138)10 0.0235294 3 0.2470588
and
y (59)10 0.0235294 3 1.6117647
@ Dr. Sakuntala Mahapatra 26/11/2020 Genetic Algorithms 74
Genetic Algorithms - Fitness Function
Example 3