Module: SA::ClassMethods

Defined in:
lib/sa.rb

Instance Method Summary collapse

Instance Method Details

#simulated_annealing(unit, options) ⇒ Object



10
11
12
13
14
15
# File 'lib/sa.rb', line 10

def simulated_annealing(unit, options)
  opts = options.each_with_object({}) {|kv, r| r[kv.first.to_sym] = kv.last }
  ctx = SA::Context.new
  ctx.annealing(unit, opts[:temp], opts[:stop_temp], opts[:cool])
  return unit
end