-
Notifications
You must be signed in to change notification settings - Fork 0
GeneticAlgorithm
FloFra edited this page Apr 15, 2018
·
3 revisions
****Genetic Algorithm:
- Initializer input: none -> number of jobs / number of machines -> time_array -> size of pool -> 2d array of chromosomes (size of pool x number of jobs) -> random -> same number of jobs for every machine return: 2d array of chromosomes
- Selector (Evaluation) input: 2d array of chromosomes -> evaluate 2d array -> roulette-selection 1 parent chromosome -> tournament-selection 1 parent chromosome return: 1 chromosome (array)
- Recombinator input: 2 chromosomes (array) -> run selector 2 times to get 2 parent chromosomes -> decide via crossover probability if they should be recombinated -> 1 point cross over and 2 point crossover output: 2 chromosomes (array) -> save kids in own array
- Mutator input: 1 chromosomes (array) -> take child and change one chromosome with small porbability -> swap method -> random method return: 1 chromosomes (array)
- Replacer input: child array -> delete-all -> take-best return: new parent array
Parameters: -> size of population -> mating pool size -> crossover probability -> mutation probability -> which algorithms
main Method: define parameters initialize -> get 2D array
do until certain time point:
run selector as often as necessary to generate mating pool recombination with two random chromosomes from mating pool until every chromosome was used once -> save in kids array mutation (go through kids array) replace: take best: take best from child array and parent array and replace complete population delete all: ?? what if population size bigger than mating pool, how does delete all work?
when time point is reached, get value of fittest of population