|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.cpsolver.ifs.model.Model net.sf.cpsolver.ifs.constant.ConstantModel
public class ConstantModel
Extension of the model with constant variables.
Such variables are excluded from the solver process, however,
they can be included in constraints. Such model can allow us to build a solution
on top of another solution (e.g., committed classes in the course timetabling).
Constant variable has to implement interface ConstantVariable
,
returning ConstantVariable.isConstant()
true.
Field Summary |
---|
Fields inherited from class net.sf.cpsolver.ifs.model.Model |
---|
iAssignedVariables, iPerturbVariables, iUnassignedVariables, sDoubleFormat, sPercentageFormat, sTimeFormat |
Constructor Summary | |
---|---|
ConstantModel()
|
Method Summary | |
---|---|
void |
addVariable(Variable variable)
Adds a variable to the model |
void |
afterAssigned(long iteration,
Value value)
Called after a value is assigned to its variable. |
void |
afterUnassigned(long iteration,
Value value)
Called after a value is unassigned from its variable. |
void |
beforeAssigned(long iteration,
Value value)
Called before a value is assigned to its variable. |
void |
beforeUnassigned(long iteration,
Value value)
Called before a value is unassigned from its variable. |
Vector |
constantVariables()
List of constant variables |
boolean |
hasConstantVariables()
True, if the model contains at least one constant variable. |
boolean |
isConstant(Variable variable)
True, if the given variable is constant. |
void |
removeVariable(Variable variable)
Removes a variable from the model |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ConstantModel()
Method Detail |
---|
public Vector constantVariables()
public boolean hasConstantVariables()
public boolean isConstant(Variable variable)
public void addVariable(Variable variable)
addVariable
in class Model
public void removeVariable(Variable variable)
removeVariable
in class Model
public void beforeAssigned(long iteration, Value value)
beforeAssigned
in class Model
public void beforeUnassigned(long iteration, Value value)
beforeUnassigned
in class Model
public void afterAssigned(long iteration, Value value)
afterAssigned
in class Model
public void afterUnassigned(long iteration, Value value)
afterUnassigned
in class Model
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |