Class KUserNumConstraint

java.lang.Object
com.artelys.kalis.KConstraint
com.artelys.kalis.KUserNumConstraint

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

    • 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 Details

    • getCPtr

      protected static long getCPtr(KUserNumConstraint obj)
    • finalize

      protected void finalize()
      Overrides:
      finalize in class KConstraint
    • delete

      public void delete()
      Overrides:
      delete in class KConstraint
    • swigDirectorDisconnect

      protected void swigDirectorDisconnect()
    • swigReleaseOwnership

      public void swigReleaseOwnership()
    • swigTakeOwnership

      public void swigTakeOwnership()
    • set_nvars

      public void set_nvars(KNumVarArray value)
    • get_nvars

      public KNumVarArray get_nvars()
    • getInstance

      public KConstraint getInstance(long pb)
      Overrides:
      getInstance in class KConstraint
    • getCopyPtr

      public KConstraint getCopyPtr()
      Virtual copy method.
      Must be implemented by the user.
      Overrides:
      getCopyPtr in class KConstraint
    • 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()
      Overrides:
      print in class KConstraint
    • 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
    • getTypeInfo

      public int getTypeInfo()
      Overrides:
      getTypeInfo in class KConstraint
    • getLinearRelaxation

      public KLinearRelaxation getLinearRelaxation(int strategy)
      Overrides:
      getLinearRelaxation in class KConstraint
    • isGetLinearRelaxationImplemented

      public boolean isGetLinearRelaxationImplemented()
      Overrides:
      isGetLinearRelaxationImplemented in class KConstraint