Class KDisjunction


  • public class KDisjunction
    extends KConstraint
    This class creates a Binary disjunction on two constraints `C1 or C2`

    Example :
    
    // C1     C2       C1 \/ C2
    // ------------------------
    // false  false    false
    // false  true     true
    // true   false    true
    // true   true     true
    
    KIntVar START(...);
    ...
    problem.post(START + 10 < 4 || START + 10 >= 4);
    // or
    problem.post(KDisjunction(START + 10 < 4,START + 10 >= 4));
    

    Since:
    2016.1
    See Also:
    KConstraint

    • Constructor Detail

      • KDisjunction

        protected KDisjunction​(long cPtr,
                               boolean cMemoryOwn)
      • KDisjunction

        public KDisjunction()
      • KDisjunction

        public KDisjunction​(KConstraint c1,
                            KConstraint c2)
        Primary constructor

        Parameters:
        c1 - the first constraint of the disjunction c1 or c2
        c2 - the second constraint of the disjunction c1 or c2
      • KDisjunction

        public KDisjunction​(KDisjunction toCopy)
        Copy constructor
      • KDisjunction

        public KDisjunction​(KProblem problem)
    • Method Detail

      • getCPtr

        protected static long getCPtr​(KDisjunction obj)
      • knownStatus

        public boolean knownStatus()
        Return the known status

        Known status is true if status of disjunction is proven at current point
        of the branch and bound, false if unknown.
      • setStatus

        public void setStatus​(int branchNumber,
                              boolean status)
        Fix status of one part of the disjunction

        Parameters:
        branchNumber - 0 for c1, 1 for c2
        status - true if corresponding constraint must be true
      • setConstraint_I_ptr

        public void setConstraint_I_ptr​(com.artelys.kalis.SWIGTYPE_p_void ptr)
      • setPrefferedBranch

        public void setPrefferedBranch​(int branch)
      • getPrefferedBranch

        public int getPrefferedBranch()
      • getActiveBranch

        public int getActiveBranch()
      • setRessource

        public void setRessource​(int ressource)
      • getRessource

        public int getRessource()