Propagation of Variables

  • Misael Viveros Castro


    I am using Jacop as  tool to propagate the domain of variables through  constraint without finding a solution. but as I add the constraing some stay in queue and do not propagate variables domains.

    I wonder if has any indicator JACOP.  to tell me if the spread of the variables already performed.

    thanks for Help.


  • kris

    kris - 2012-11-06


    If you add constraints to the store using impose method the constraints and needed data structure are created but consistency of the store is not carried out. You need to do one of the following:

    1. impose constraint with imposeWithConsistency method, or
    2. call store.consistency() method after imposing constraints.

    For more info please consult section 2.3 ( in JaCoP Guide.


  • Misael Viveros Castro

    Thank you very much for your reply.

    The propagation of the variables is done, but what would be the correct way to restore the store (variables) to its original state. Since I'm putting a new store (modelStore.set (JaCoP.core.Store new ())  and then created variables again. Jacop shows JaCoP.core.FailException but when I add another constraint.

    Thank you very much for your help.


  • kris

    kris - 2012-11-06

    The best and easiest way to restore the store is to simply build it again. The harder way is to use store levels. Basically you can increase the level before consistency using setLevel method and then remove the level using removeLevel method, when you do not need it any longer. It should work but it is a little bit tricky. We do not propose it for normal use and therefore it is not described anywhere.


  • Radoslaw Szymanek


    The levels is the efficient way to try different models if they share a lot of common constraints. Make search in the code for functions store.level() and store.setLevel(int) and store.removeLevel().

    Any constraints added at a given level, any changes to the domain of variables at the given level will be removed when the level is removed. Before doing changes that you may want to revert you need to increase level, afterwards you just delete the level. Do not do this type of operations on level 0 as you may cause constraints get into inconsistent state as they store at level 0 their internal state.

    Hope that helps. It is not typical use of JaCoP so it is not described. It is very easy to get in trouble so be warned.


  • Misael Viveros Castro


    Thank you very much for your timely reply. Was a big help.

    greetings to all.



Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks