specs/branch.rb in gecoder-0.7.1 vs specs/branch.rb in gecoder-0.8.0
- old
+ new
@@ -20,11 +20,11 @@
end
it 'should default to :none and :min' do
Gecode::Raw.should_receive(:branch).once.with(
an_instance_of(Gecode::Raw::Space),
- anything, Gecode::Raw::BVAR_NONE, Gecode::Raw::BVAL_MIN)
+ anything, Gecode::Raw::INT_VAR_NONE, Gecode::Raw::INT_VAL_MIN)
@model.branch_on @vars
@model.solve!
end
it 'should ensure that branched int variables are assigned in a solution' do
@@ -36,23 +36,23 @@
@model.branch_on @bools
@model.solve!.bools.each{ |var| var.should be_assigned }
end
supported_var_selectors = {
- :none => Gecode::Raw::BVAR_NONE,
- :smallest_min => Gecode::Raw::BVAR_MIN_MIN,
- :largest_min => Gecode::Raw::BVAR_MIN_MAX,
- :smallest_max => Gecode::Raw::BVAR_MAX_MIN,
- :largest_max => Gecode::Raw::BVAR_MAX_MAX,
- :smallest_size => Gecode::Raw::BVAR_SIZE_MIN,
- :largest_size => Gecode::Raw::BVAR_SIZE_MAX,
- :smallest_degree => Gecode::Raw::BVAR_DEGREE_MIN,
- :largest_degree => Gecode::Raw::BVAR_DEGREE_MAX,
- :smallest_min_regret => Gecode::Raw::BVAR_REGRET_MIN_MIN,
- :largest_min_regret => Gecode::Raw::BVAR_REGRET_MIN_MAX,
- :smallest_max_regret => Gecode::Raw::BVAR_REGRET_MAX_MIN,
- :largest_max_regret => Gecode::Raw::BVAR_REGRET_MAX_MAX
+ :none => Gecode::Raw::INT_VAR_NONE,
+ :smallest_min => Gecode::Raw::INT_VAR_MIN_MIN,
+ :largest_min => Gecode::Raw::INT_VAR_MIN_MAX,
+ :smallest_max => Gecode::Raw::INT_VAR_MAX_MIN,
+ :largest_max => Gecode::Raw::INT_VAR_MAX_MAX,
+ :smallest_size => Gecode::Raw::INT_VAR_SIZE_MIN,
+ :largest_size => Gecode::Raw::INT_VAR_SIZE_MAX,
+ :smallest_degree => Gecode::Raw::INT_VAR_DEGREE_MIN,
+ :largest_degree => Gecode::Raw::INT_VAR_DEGREE_MAX,
+ :smallest_min_regret => Gecode::Raw::INT_VAR_REGRET_MIN_MIN,
+ :largest_min_regret => Gecode::Raw::INT_VAR_REGRET_MIN_MAX,
+ :smallest_max_regret => Gecode::Raw::INT_VAR_REGRET_MAX_MIN,
+ :largest_max_regret => Gecode::Raw::INT_VAR_REGRET_MAX_MAX
}.each_pair do |name, gecode_const|
it "should support #{name} as variable selection strategy" do
Gecode::Raw.should_receive(:branch).once.with(
an_instance_of(Gecode::Raw::Space),
anything, gecode_const, an_instance_of(Numeric))
@@ -60,15 +60,15 @@
@model.solve!
end
end
supported_val_selectors = {
- :min => Gecode::Raw::BVAL_MIN,
- :med => Gecode::Raw::BVAL_MED,
- :max => Gecode::Raw::BVAL_MAX,
- :split_min => Gecode::Raw::BVAL_SPLIT_MIN,
- :split_max => Gecode::Raw::BVAL_SPLIT_MAX
+ :min => Gecode::Raw::INT_VAL_MIN,
+ :med => Gecode::Raw::INT_VAL_MED,
+ :max => Gecode::Raw::INT_VAL_MAX,
+ :split_min => Gecode::Raw::INT_VAL_SPLIT_MIN,
+ :split_max => Gecode::Raw::INT_VAL_SPLIT_MAX
}.each_pair do |name, gecode_const|
it "should support #{name} as value selection strategy" do
Gecode::Raw.should_receive(:branch).once.with(
an_instance_of(Gecode::Raw::Space),
anything, an_instance_of(Numeric), gecode_const)
@@ -109,26 +109,26 @@
end
it 'should default to :none and :min' do
Gecode::Raw.should_receive(:branch).once.with(
an_instance_of(Gecode::Raw::Space),
- anything, Gecode::Raw::SETBVAR_NONE, Gecode::Raw::SETBVAL_MIN)
+ anything, Gecode::Raw::SET_VAR_NONE, Gecode::Raw::SET_VAL_MIN)
@model.branch_on @sets
@model.solve!
end
it 'should ensure that branched set variables are assigned in a solution' do
@model.branch_on @sets
@model.solve!.sets.each{ |var| var.should be_assigned }
end
supported_var_selectors = {
- :none => Gecode::Raw::SETBVAR_NONE,
- :smallest_cardinality => Gecode::Raw::SETBVAR_MIN_CARD,
- :largest_cardinality => Gecode::Raw::SETBVAR_MAX_CARD,
- :smallest_unknown => Gecode::Raw::SETBVAR_MIN_UNKNOWN_ELEM,
- :largest_unknown => Gecode::Raw::SETBVAR_MAX_UNKNOWN_ELEM
+ :none => Gecode::Raw::SET_VAR_NONE,
+ :smallest_cardinality => Gecode::Raw::SET_VAR_MIN_CARD,
+ :largest_cardinality => Gecode::Raw::SET_VAR_MAX_CARD,
+ :smallest_unknown => Gecode::Raw::SET_VAR_MIN_UNKNOWN_ELEM,
+ :largest_unknown => Gecode::Raw::SET_VAR_MAX_UNKNOWN_ELEM
}.each_pair do |name, gecode_const|
it "should support #{name} as variable selection strategy" do
Gecode::Raw.should_receive(:branch).once.with(
an_instance_of(Gecode::Raw::Space),
anything, gecode_const, an_instance_of(Numeric))
@@ -136,11 +136,11 @@
@model.solve!
end
end
supported_val_selectors = {
- :min => Gecode::Raw::SETBVAL_MIN,
- :max => Gecode::Raw::SETBVAL_MAX
+ :min => Gecode::Raw::SET_VAL_MIN,
+ :max => Gecode::Raw::SET_VAL_MAX
}.each_pair do |name, gecode_const|
it "should support #{name} as value selection strategy" do
Gecode::Raw.should_receive(:branch).once.with(
an_instance_of(Gecode::Raw::Space),
anything, an_instance_of(Numeric), gecode_const)
\ No newline at end of file