Method: EvoSynth::Evolvers::BalancedCoevolutionary#initialize

Defined in:
lib/evosynth/evolvers/coevolutionary/balanced_coevolutionary.rb

#initialize(profile) ⇒ BalancedCoevolutionary

Returns a new instance of BalancedCoevolutionary.



42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# File 'lib/evosynth/evolvers/coevolutionary/balanced_coevolutionary.rb', line 42

def initialize(profile)
	init_profile :population,
		:problems,
	    :evaluator,
		:mutation,
	    :problem_mutation,
		:recombination => DEFAULT_RECOMBINATION,
	    :problem_recombination => DEFAULT_RECOMBINATION,
		:parent_selection => DEFAULT_SELECTION,
		:enviromental_selection => DEFAULT_SELECTION,
		:pairing_runs => DEFAULT_PAIRING_RUNS

	use_profile profile

	# intialize fitnesses?! FIXME: find a better way to do this
	solution = @parent_selection.select(@population, 1).first
	@problems.each do |problem|
		@evaluator.encounter(problem, solution)
	end

	problem = @parent_selection.select(@problems, 1).first
	@population.each do |solution|
		@evaluator.encounter(problem, solution)
	end
end