Package com.artelys.kalis
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
KUserNumConstraint.askRet
askIfEntailed return values
-
Field Summary
-
Fields inherited from class com.artelys.kalis.KConstraint
swigCMemOwn
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
KUserNumConstraint(long cPtr, boolean cMemoryOwn)
KUserNumConstraint(KNumVar v1)
Constructor for unary constraintsKUserNumConstraint(KNumVarArray vars)
Constructor for n-ary constraintsKUserNumConstraint(KNumVar v1, KNumVar v2)
Constructor for binary constraintsKUserNumConstraint(KUserNumConstraint toCopy)
Copy constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
askIfEntailed()
Virtual method for use within boolean connectors
void
awake()
Virtual method called upon initialization of the constraintvoid
awakeOnInf(KNumVar var)
Virtual method called when the lower bound of var has been raisedvoid
awakeOnInst(KNumVar var)
Virtual method called when the variable var has been instantiated
void
awakeOnRem(KIntVar var, int removedValue)
Virtual method called when the value removedValue has been removed from the domain of var
void
awakeOnSup(KNumVar var)
Virtual method called when the upper bound of var has been lowered
void
awakeOnVar(KNumVar var)
Virtual method called when the domain of variable var has changed
void
constAwake()
void
delete()
protected void
finalize()
KNumVarArray
get_nvars()
KConstraint
getCopyPtr()
Virtual copy method.
Must be implemented by the user.protected static long
getCPtr(KUserNumConstraint obj)
KConstraint
getInstance(long pb)
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.KLinearRelaxation
getLinearRelaxation(int strategy)
int
getTypeInfo()
boolean
isGetLinearRelaxationImplemented()
void
print()
void
print(com.artelys.kalis.SWIGTYPE_p_std__ostream fout)
Pretty printing of the constraintvoid
print(com.artelys.kalis.SWIGTYPE_p_void ctx, com.artelys.kalis.SWIGTYPE_p_f_p_void_p_q_const__char__int pfp)
void
propagate()
Virtual method called when the domain of some or several variables has changedvoid
set_nvars(KNumVarArray value)
protected void
swigDirectorDisconnect()
void
swigReleaseOwnership()
void
swigTakeOwnership()
-
Methods inherited from class com.artelys.kalis.KConstraint
getArity, getCPtr, getLinearRelaxation, getName, getPriority, getProblem, getTag, setName, setPriority, setTag
-
-
-
-
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
-
getCPtr
protected static long getCPtr(KUserNumConstraint obj)
-
finalize
protected void finalize()
- Overrides:
finalize
in classKConstraint
-
delete
public void delete()
- Overrides:
delete
in classKConstraint
-
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 classKConstraint
-
getCopyPtr
public KConstraint getCopyPtr()
Virtual copy method.
Must be implemented by the user.- Overrides:
getCopyPtr
in classKConstraint
-
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 classKConstraint
-
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 domainremovedValue
- 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 classKConstraint
- 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 classKConstraint
-
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 classKConstraint
-
getTypeInfo
public int getTypeInfo()
- Overrides:
getTypeInfo
in classKConstraint
-
getLinearRelaxation
public KLinearRelaxation getLinearRelaxation(int strategy)
- Overrides:
getLinearRelaxation
in classKConstraint
-
isGetLinearRelaxationImplemented
public boolean isGetLinearRelaxationImplemented()
- Overrides:
isGetLinearRelaxationImplemented
in classKConstraint
-
-