The main steps of applying GA to any problem have been presented as follows.
- Step 1: Code the problem as a binary chromosome
- Step 2: Choose the size of a chromosome population N
- Step 3.Select genetic operators as crossover probability pc and the mutation probability pm.
- Step 4: Define a fitness function.
- Step 5: Randomly generate an initial population of N
- Step 6: Calculate the fitness of each individual chromosome:
- Step 7: Select a pair of chromosomes to generate next generation.
- Step 8: Create a pair of offspring chromosomes
- Step 9: Place the created offspring chromosomes in the new population.
- Step 10: Replace the initial (parent) chromosome population with the new (offspring) population.
- Step 11: Go to Step 6, and repeat the process
Few parameters used in Algorithem
-
HC_DFi : destination floor of HCi
-
maxHC_DF↑ : maximum destination floor of upHCs greater than CFn
-
maxHC↓ : maximum down HC
-
minHC_DF↓ : minimum destination floor of down HCs less than CFn
-
m inH C↑ : minimum up HC
-
CAR_DF: matrix of car destination floors (if car is stopped, it is equal to CF)
-
Y: maximum of the destination floors of up HCs less than CFn
-
Z: minimum of the destination floors of down HCs greater than CFn
-
MAX = max( HC_DF , CAR_DF, HC )↑ ↓
-
MIN = minMIN=min( HC_DF , HC )