Class: Wallace::Operators::BoundaryMutationOperator

Inherits:
Wallace::Operator show all
Defined in:
lib/operators/boundary_mutation_operation.rb

Instance Method Summary collapse

Methods inherited from Wallace::Operator

#produce

Constructor Details

#initialize(opts = {}) ⇒ BoundaryMutationOperator

Constructs a new boundary mutation operator.

Parameters:

  • opts, a hash of keyword options for this method. -> id, the unique identifier for this operator. -> inputs, an array of inputs (OperatorInput) to this operator. -> values, the collection of values that each gene can take.



12
13
14
15
# File 'lib/operators/boundary_mutation_operation.rb', line 12

def initialize(opts = {})
  super(opts)
  @values = opts[:values] # Extract this from the species?
end

Instance Method Details

#operate(rng, inputs) ⇒ Object



17
18
19
20
21
22
23
24
25
26
# File 'lib/operators/boundary_mutation_operation.rb', line 17

def operate(rng, inputs)
 # x = inputs[0]

  # Select a gene to mutate.
  #index = rng.rand(x.data.length)
  
  #x.data[rng.rand(x.data.length)] =
  
  return inputs
end