class

YAGA::Population(T, V)

Inherits Reference < Object

Constants

MUTATION_PERCENT = 10_u8
PERCENT_RANGE = 1_u8..100_u8
SELECTION_BOTS = 8_u32
SIMULATIONS_HISTORY = 400_u64
TOTAL_BOTS = 64_u32

Constructors

new(total_bots : UInt32 = TOTAL_BOTS, selection_bots : UInt32 = SELECTION_BOTS, mutation_percent : UInt8 = MUTATION_PERCENT, crossover_enabled : Bool = true, random : Random = Random.new, &)
Source
new(total_bots : UInt32 = TOTAL_BOTS, selection_bots : UInt32 = SELECTION_BOTS, mutation_percent : UInt8 = MUTATION_PERCENT, crossover_enabled : Bool = true, random : Random = Random.new)
Source

Instance methods

after_evolution
Source
after_simulation
Source
after_training
Source
before_evolution
Source
before_simulation
Source
before_training
Source
bots
Source
crossover

Crossover specific amount of bots with best selection

Source
evolve!(native : Bool = false) : Void

Usually it is not needed to call this method explicitly But there are no restrictions about that Do not use argument native, it is only for internal usage Or selection will not be collected

Source
finalize_evolution

Reset lask part of bots to prevent stagnation

Source
fitness_history
Source
generation
Source
generation=(generation : UInt64)
Source
mutate

Mutate specific amount of bots out of selection

Source
selection
Source
selection_bots
Source
simulate_each
Source
simulate_world
Source
total_bots
Source
train_each(goal : V, generation_cap : UInt64 = 10000_u64, &block : Bot(T, V), UInt64 -> V) : UInt64
Source
train_world(goal : V, generation_cap : UInt64 = 10000_u64, &block : Array(Bot(T, V)), UInt64 -> Void) : UInt64
Source