You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Store store = new Store ();
// Create the variables
IntVar cost = new IntVar (store, "cost", 0, 2);
IntVar[] vars = new IntVar [2];
vars[0] = new IntVar (store, "v_0", 0, 1);
vars[1] = new IntVar (store, "v_1", 0, 1);
// Ground the variables using In constraints, such that the store is infeasible
store.impose(new In (cost, new IntervalDomain (0, 0)));
store.impose(new In (vars[0], new IntervalDomain (0, 0)));
store.impose(new In (vars[1], new IntervalDomain (0, 0)));
// Impose a SoftAlldifferent constraint
store.imposeDecomposition(new SoftAlldifferent (vars, cost, ViolationMeasure.DECOMPOSITION_BASED));
System.out.println(store.consistency());
throws
Exception in thread "main" java.lang.AssertionError: non-optimal arcs:
[1->sink, flow=0/1 reduced=-1, index=2]
at org.jacop.constraints.netflow.Assert.checkOptimality(Assert.java:269)
at org.jacop.constraints.netflow.simplex.NetworkSimplex.networkSimplex(NetworkSimplex.java:368)
at org.jacop.constraints.netflow.NetworkFlow.consistency(NetworkFlow.java:255)
at org.jacop.core.Store.consistency(Store.java:547)
when asserts are enabled.
The text was updated successfully, but these errors were encountered:
thomasleaute
changed the title
SoftAllDifferent incorrectly throws AssertionErrors on infeasible stores
SoftAllDifferent and SoftGCC incorrectly throw AssertionErrors on infeasible stores
Dec 13, 2020
Store store = new Store ();
// Create the variables
IntVar cost = new IntVar (store, "cost", 0, 2);
IntVar[] xVars = new IntVar[2];
xVars[0] = new IntVar (store, "x0", 0, 1);
xVars[1] = new IntVar (store, "x1", 0, 1);
IntVar[] hardCounters = new IntVar [2];
hardCounters[0] = new IntVar (store, "hardCounter0", 0, 2);
hardCounters[1] = new IntVar (store, "hardCounter1", 0, 2);
IntVar[] softCounters = new IntVar [2];
softCounters[0] = new IntVar (store, "softCounter0", 0, 2);
softCounters[1] = new IntVar (store, "softCounter1", 0, 2);
// Ground the variables using In constraints such that the store is infeasible
store.impose(new In (xVars[0], new IntervalDomain (0, 0)));
store.impose(new In (xVars[1], new IntervalDomain (0, 0)));
store.impose(new In (hardCounters[0], new IntervalDomain (2, 2)));
store.impose(new In (softCounters[0], new IntervalDomain (1, 1)));
store.impose(new In (softCounters[1], new IntervalDomain (2, 2)));
store.impose(new In (cost, new IntervalDomain (1, 1)));
// Impose a SoftGCC
store.imposeDecomposition(new SoftGCC (xVars, hardCounters, softCounters, cost, ViolationMeasure.VALUE_BASED));
System.out.println(store.consistency());
throws:
Exception in thread "main" java.lang.AssertionError: non-optimal arcs:
[1->c_1, flow=0/2 reduced=-2, index=2, forward = true, companion = [offset = 0, xVar = hardCounter1}]]
at org.jacop.constraints.netflow.Assert.checkOptimality(Assert.java:269)
at org.jacop.constraints.netflow.simplex.NetworkSimplex.networkSimplex(NetworkSimplex.java:368)
at org.jacop.constraints.netflow.NetworkFlow.consistency(NetworkFlow.java:255)
at org.jacop.core.Store.consistency(Store.java:547)
The following code:
throws
when asserts are enabled.
The text was updated successfully, but these errors were encountered: