dino_game_v2.rb
# The training function performs selection and mutation operators on the population to create new population

The training function performs selection and mutation operators on the population to create new population
The training function performs selection and mutation operators on the population to create new population
def train(dinos)
	parents, least_fit_of_pop = selection(dinos)
	dinos, first_child, second_child = crossover(dinos, parents, least_fit_of_pop)
	if MUTATE_GENES
		dinos = mutate(dinos, first_child, second_child)
	end	
	dinos
end
def train ( dinos ) parents , least_fit_of_pop = selection ( dinos ) dinos , first_child , second_child = crossover ( dinos , parents , least_fit_of_pop ) if MUTATE_GENES dinos = mutate ( dinos , first_child , second_child ) end dinos end
The training function performs selection and mutation operators on the population to create new population
The training function performs selection and mutation operators on the population to create new population
# Only mutate genes if MUTATE_GENES is set to true

dinos
<not_specific>