lib/gecoder/bindings.rb in gecoder-0.9.0 vs lib/gecoder/bindings.rb in gecoder-0.9.1

- old
+ new

@@ -1,8 +1,8 @@ # Problems can be formulated and solved either through defining a new -# class that inherits from Gecode::Model or by using Gecode#solve et al. -# Gecode::Model describes how to formulate problems. +# class that mixes in Gecode::Mixin or by using Gecode.solve et al. +# Gecode::Mixin describes how to formulate problems. # # ==== Examples # # The following two examples show how to solve the following equation # system, using both ways to define and solve a problem. @@ -10,13 +10,15 @@ # Equation system: # x + y = z # x = y - 3 # 0 <= x,y,z <= 9 # -# === Inheriting from Gecode::Model +# === Mixing in Gecode::Mixin # -# class EquationProblem < Gecode::Model +# class EquationProblem +# include Gecode::Mixin +# # def initialize # variables_is_an int_var_array(3, 0..9) # x, y, z = variables # # (x + y).must == z @@ -25,10 +27,10 @@ # branch_on variables # end # end # puts EquationProblem.new.solve!.variables.join(' ') # -# === Using Gecode#solve +# === Using Gecode.solve # # solution = Gecode.solve do # variables_is_an int_var_array(3, 0..9) # x, y, z = variables #