Skip to content

Commit 2d3f537

Browse files
committed
Fix subscription of IntLinearLessEqBounds
1 parent a0c3a86 commit 2d3f537

File tree

7 files changed

+13
-12
lines changed

7 files changed

+13
-12
lines changed

crates/fzn-huub/benches/fzn_huub_benchmarks.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ use fzn_huub::Cli;
2323
use pico_args::Arguments;
2424

2525
/// A configuration for instances that run for a few seconds.
26-
const _FEW_SECONDS_CONFIG: CriterionConfig = CriterionConfig {
26+
const FEW_SECONDS_CONFIG: CriterionConfig = CriterionConfig {
2727
sampling_mode: Some(SamplingMode::Flat),
2828
sample_size: Some(10),
2929
measurement_time: Some(Duration::from_secs(60)),
@@ -99,10 +99,7 @@ fn check_final(name: &str, instance_type: InstanceType) {
9999
);
100100
slice = &slice[..slice.len() - FZN_SEPERATOR.len()];
101101
let sol = base.with_extension("sol").canonicalize().unwrap();
102-
match instance_type {
103-
InstanceType::Optimization => assert!(slice.contains(&expect_file![sol].data())),
104-
InstanceType::Satisfaction => expect_file![sol].assert_eq(slice),
105-
}
102+
expect_file![sol].assert_eq(slice);
106103
}
107104

108105
/// Benchmarks of optimization problems (finding the optimal solution).
@@ -113,7 +110,7 @@ fn optimization(c: &mut Criterion) {
113110
let mut group = c.benchmark_group("optimization");
114111
let instances = vec![
115112
("jobshop_la01", &MILLISECONDS_CONFIG),
116-
("jobshop_la02", &MILLISECONDS_CONFIG),
113+
("jobshop_la02", &FEW_SECONDS_CONFIG),
117114
("jobshop_la03", &MILLISECONDS_CONFIG),
118115
("jobshop_la04", &MILLISECONDS_CONFIG),
119116
("jobshop_la05", &INSTANT_CONFIG),
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
objective = 666;
2-
start = [0,21,77,290,585,0,39,172,195,427,0,448,558,619,650,21,157,369,519,585,74,160,221,498,546,98,152,290,369,461,91,188,265,432,557,0,212,517,558,583,194,211,265,290,334,0,211,290,352,461];
2+
start = [0,21,77,290,585,0,39,172,195,487,0,448,558,619,650,21,157,369,519,585,74,160,221,468,546,98,152,290,369,461,91,188,265,432,557,0,212,427,523,583,194,211,265,290,334,0,211,290,352,461];
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
objective = 655;
2-
start = [0,20,400,450,572,0,25,57,81,107,0,72,95,123,236,95,229,305,448,510,39,81,188,236,354,162,275,402,483,510,66,305,335,493,589,99,181,275,433,526,25,373,448,498,600,123,195,317,354,573];
2+
start = [0,20,391,453,573,0,25,57,84,126,0,72,95,136,255,95,232,308,461,510,67,94,207,255,345,165,288,405,483,511,39,72,107,506,590,102,194,288,433,529,25,386,461,511,600,123,195,308,354,586];
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
objective = 597;
2-
start = [0,79,376,458,542,0,23,91,295,397,21,59,336,490,545,0,37,124,228,340,238,295,379,447,548,101,200,290,404,515,0,59,109,352,479,37,61,458,493,580,182,279,286,340,440,61,145,542,578,588];
2+
start = [0,79,376,458,542,0,23,91,295,340,21,59,336,490,545,0,37,124,228,390,238,295,379,447,548,101,200,290,404,515,0,59,109,352,479,37,61,458,493,580,182,279,286,340,440,61,145,542,578,588];
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
objective = 590;
2-
start = [0,304,398,490,581,0,19,30,452,473,19,33,113,207,432,135,230,323,384,450,33,107,113,308,398,30,115,170,296,397,230,309,418,490,581,78,166,246,384,482,0,96,108,170,294,61,202,235,294,330];
2+
start = [0,304,398,490,581,0,19,30,452,486,19,33,113,213,432,135,230,339,346,445,33,107,124,262,398,30,115,186,296,392,230,304,434,490,581,78,185,277,384,482,54,115,124,200,254,0,96,126,185,346];
+4
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
objective = 117;
2+
X_INTRODUCED_0_ = [6,7,2,1,3,5,4,6,7,2,1,3,5,4,6,7,2,1,3,5,4,6,3,7,1,2,5,4];
3+
X_INTRODUCED_29_ = [4,3,5,7,6,1,2,4,3,5,7,6,1,2,4,3,5,7,6,1,2,4,5,2,7,6,1,3];
4+
vehicle = [1,2,2,1,2,1,2];
5+
X_INTRODUCED_65_ = [2,6,2,0,0,12,12,2,8,2,0,0,12,16,2,8,2,0,0,12,16,2,1,10,0,0,12,15];

crates/huub/src/constraints/int_linear.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ impl IntLinearLessEqBounds {
454454
);
455455
solver.enqueue_now(prop);
456456
for &v in vars.iter() {
457-
solver.enqueue_on_int_change(prop, v, IntPropCond::UpperBound);
457+
solver.enqueue_on_int_change(prop, v, IntPropCond::LowerBound);
458458
}
459459
}
460460
}
@@ -571,7 +571,7 @@ impl IntLinearLessEqImpBounds {
571571
);
572572
solver.enqueue_now(prop);
573573
for &v in vars.iter() {
574-
solver.enqueue_on_int_change(prop, v, IntPropCond::UpperBound);
574+
solver.enqueue_on_int_change(prop, v, IntPropCond::LowerBound);
575575
}
576576
solver.enqueue_on_bool_change(prop, BoolView(BoolViewInner::Lit(reification)));
577577
}

0 commit comments

Comments
 (0)