Module: Algorithms::SimulatedAnnealing::Support

Defined in:
lib/algorithms/simulated_annealing.rb

Instance Method Summary collapse

Instance Method Details

#included(aModule) ⇒ Object



145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
# File 'lib/algorithms/simulated_annealing.rb', line 145

def included ( aModule )

  aModule.module_eval do

    #
    # Return a transition which can be applied by apply_transition.
    #
    def choose_transition ( generator=nil )
      raise NotImplementedError
    end

    #
    # Return a cost difference
    #
    def transition_cost ( current_cost, transition )
      raise NotImplementedError
    end

    #
    # Apply the given transition to your current object.
    #
    def apply_transition ( transition )
      raise NotImplementedError
    end

    #
    # This method should return the copy of the current solution
    # it will be called to save the best solution (argmin).
    #
    def copy_of_the_current_solution
      raise NotImplementedError
    end

  end

end