Module: Algorithms::GeneticAlgorithm::Solution
- Included in:
- ArraySolution, BitsetSolution, CombinationSolution, PermutationSolution
- Defined in:
- lib/algorithms/genetic_algorithm/genetic_algorithm.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
5 6 7 |
# File 'lib/algorithms/genetic_algorithm/genetic_algorithm.rb', line 5 def data @data end |
Instance Method Details
#create_new_solution(data) ⇒ Object
9 10 11 12 13 |
# File 'lib/algorithms/genetic_algorithm/genetic_algorithm.rb', line 9 def create_new_solution(data) new_solution = self.clone new_solution.instance_variable_set(:@data, data) new_solution end |
#valid? ⇒ Boolean
7 |
# File 'lib/algorithms/genetic_algorithm/genetic_algorithm.rb', line 7 def valid?; true; end |