Code Monkey home page Code Monkey logo

Comments (2)

thomasleaute avatar thomasleaute commented on August 25, 2024

Same issue with SoftGCC:

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)

from jacop.

thomasleaute avatar thomasleaute commented on August 25, 2024

Still reproducible in JaCoP 4.10.0.

from jacop.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.