Class KUserNumConstraint


  • public class KUserNumConstraint
    extends KConstraint
    The KUserNumConstraint is the generic counterpart to the KUserConstraint for
    implementing user constraints when using numeric variables.
    • Constructor Detail

      • KUserNumConstraint

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

        public KUserNumConstraint​(KNumVar v1)
        Constructor for unary constraints
      • KUserNumConstraint

        public KUserNumConstraint​(KNumVar v1,
                                  KNumVar v2)
        Constructor for binary constraints
      • KUserNumConstraint

        public KUserNumConstraint​(KNumVarArray vars)
        Constructor for n-ary constraints
      • KUserNumConstraint

        public KUserNumConstraint​(KUserNumConstraint toCopy)
        Copy constructor
    • Method Detail

      • swigDirectorDisconnect

        protected void swigDirectorDisconnect()
      • swigReleaseOwnership

        public void swigReleaseOwnership()
      • swigTakeOwnership

        public void swigTakeOwnership()
      • getInstanceCopyPtr

        public KConstraint getInstanceCopyPtr​(KProblem problem)
        Virtual instance copy method.
        Each modeling elements stored (and used) in the user constraint must be copied using the KProblem::getCopyPtr() method.
        Must be implemented by the user when solving problems in parallel.
        Overrides:
        getInstanceCopyPtr in class KConstraint
      • propagate

        public void propagate()
        Virtual method called when the domain of some or several variables has changed
      • awake

        public void awake()
        Virtual method called upon initialization of the constraint
      • awakeOnInf

        public void awakeOnInf​(KNumVar var)
        Virtual method called when the lower bound of var has been raised
      • awakeOnSup

        public void awakeOnSup​(KNumVar var)
        Virtual method called when the upper bound of var has been lowered

        Parameters:
        var - the variable with modified domain
      • awakeOnInst

        public void awakeOnInst​(KNumVar var)
        Virtual method called when the variable var has been instantiated

        Parameters:
        var - the variable with modified domain
      • awakeOnRem

        public void awakeOnRem​(KIntVar var,
                               int removedValue)
        Virtual method called when the value removedValue has been removed from the domain of var

        Parameters:
        var - the variable with modified domain
        removedValue - the value that has been removed from the domain of var
      • awakeOnVar

        public void awakeOnVar​(KNumVar var)
        Virtual method called when the domain of variable var has changed

        Parameters:
        var - the variable with modified domain
      • askIfEntailed

        public int askIfEntailed()
        Virtual method for use within boolean connectors

        Overrides:
        askIfEntailed in class KConstraint
        Returns:
        CTRUE whenever the constraint is definitively satisfied
      • constAwake

        public void constAwake()
      • print

        public void print​(com.artelys.kalis.SWIGTYPE_p_std__ostream fout)
        Pretty printing of the constraint
      • print

        public void print​(com.artelys.kalis.SWIGTYPE_p_void ctx,
                          com.artelys.kalis.SWIGTYPE_p_f_p_void_p_q_const__char__int pfp)
        Overrides:
        print in class KConstraint