Skip to content

GeneticAlgorithm

FloFra edited this page Apr 15, 2018 · 3 revisions

****Genetic Algorithm:

  1. 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
  2. Selector (Evaluation) input: 2d array of chromosomes -> evaluate 2d array -> roulette-selection 1 parent chromosome -> tournament-selection 1 parent chromosome return: 1 chromosome (array)
  3. 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
  4. Mutator input: 1 chromosomes (array) -> take child and change one chromosome with small porbability -> swap method -> random method return: 1 chromosomes (array)
  5. 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

Clone this wiki locally