Method: Gecode.solve
- Defined in:
- lib/gecoder/interface/convenience.rb
.solve(&block) ⇒ Object
Provides a convenient way to construct a model and then find a solution. The model constructed uses the specified block as initialization method. The first solution to the model is then returned.
For instance
solution = Gecode.solve do
# Do something
end
is equivalent to
class Foo
include Gecode::Mixin
def initialize
# Do something
end
end
solution = Foo.new.solve!
30 31 32 |
# File 'lib/gecoder/interface/convenience.rb', line 30 def self.solve(&block) create_model(&block).solve! end |