Monday, June 30, 2003

Pseudocode for GA from

create initial population
while (!done) {
evaluate fitness for each individual
select mating pool
apply genetic operators to mating pool to create new individuals
replace worst individuals with new individuals
report results
Pseudocode for select mating pool (probalistically on the basis of fitness)
given a list of individuals, each with a fitness, and a runningSum variable
for each individual {
sum += fitness
runningSum = sum
iterate p times (p is the number of individuals in the mating pool) {
r = random number between 0 and sum-1
start with first individual on list
while runningSum < r
go to next individual
add current individual to mating pool

Pseudo for Genetic Programming from
initialise population P(0)
evaluate P(0)
while (t t=t+1
Recombine P(t-1) --> P(t)
Mutate P(t) --> P(t)
Evaluate P(t)
Tournament selection P(t) --> P(t)