lib/gecoder/interface/search.rb in gecoder-0.7.0 vs lib/gecoder/interface/search.rb in gecoder-0.7.1
- old
+ new
@@ -41,13 +41,13 @@
# constrain the solution so that that only "better" solutions can be new
# solutions. For instance if one wants to optimize a variable named price
# (accessible from the model) to be as low as possible then one should write
# the following.
#
- # model.optimize! do |model, best_so_far|
- # model.price.must < best_so_far.price.val
- # end
+ # model.optimize! do |model, best_so_far|
+ # model.price.must < best_so_far.price.val
+ # end
#
# Returns nil if there is no solution.
def optimize!(&block)
# Execute constraints.
perform_queued_gecode_interactions
@@ -78,17 +78,17 @@
refresh_variables
@active_space = result
return self
end
- class <<self
+ class <<self
# Sets the proc that should be used to handle constrain requests.
- def constrain_proc=(proc)
+ def constrain_proc=(proc) #:nodoc:
@constrain_proc = proc
end
# Called by spaces when they want to constrain as part of BAB-search.
- def constrain(home, best)
+ def constrain(home, best) #:nodoc:
if @constrain_proc.nil?
raise NotImplementedError, 'Constrain method not implemented.'
else
@constrain_proc.call(home, best)
end