Class: PickStrategy
- Inherits:
-
Object
- Object
- PickStrategy
- Defined in:
- lib/gimuby/genetic/population/pick_strategy/pick_strategy.rb
Direct Known Subclasses
BestsPickStrategy, RandomWheelPickStrategy, TournamentPickStrategy
Instance Attribute Summary collapse
-
#pick_proportion ⇒ Object
Returns the value of attribute pick_proportion.
Instance Method Summary collapse
-
#initialize ⇒ PickStrategy
constructor
A new instance of PickStrategy.
-
#pick(population) ⇒ Object
pick some solution inside the population.
Constructor Details
#initialize ⇒ PickStrategy
Returns a new instance of PickStrategy.
4 5 6 |
# File 'lib/gimuby/genetic/population/pick_strategy/pick_strategy.rb', line 4 def initialize @pick_proportion ||= 25.to_f / 100.to_f end |
Instance Attribute Details
#pick_proportion ⇒ Object
Returns the value of attribute pick_proportion
8 9 10 |
# File 'lib/gimuby/genetic/population/pick_strategy/pick_strategy.rb', line 8 def pick_proportion @pick_proportion end |
Instance Method Details
#pick(population) ⇒ Object
pick some solution inside the population
11 12 13 |
# File 'lib/gimuby/genetic/population/pick_strategy/pick_strategy.rb', line 11 def pick(population) raise NotImplementedError end |