|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectJaCoP.constraints.DecomposedConstraint
JaCoP.constraints.Constraint
JaCoP.constraints.Sum
public class Sum
Sum constraint implements the summation over several Variable's . It provides the sum from all Variable's on the list.
| Field Summary | |
|---|---|
IntVar[] |
list
It specifies the variables to be summed. |
IntVar |
sum
It specifies variable sum to store the overall sum of the variables being summed up. |
static java.lang.String[] |
xmlAttributes
It specifies the arguments required to be saved by an XML format as well as the constructor being called to recreate an object from an XML format. |
| Fields inherited from class JaCoP.constraints.Constraint |
|---|
atomicExecution, consistencyPruningEvents, earlyTerminationOK, id, increaseWeight, numberArgs, numberId |
| Fields inherited from class JaCoP.constraints.DecomposedConstraint |
|---|
queueIndex |
| Constructor Summary | |
|---|---|
Sum(java.util.ArrayList<? extends IntVar> list,
IntVar sum)
It creates a sum constraints which sums all variables and makes it equal to variable sum. |
|
Sum(IntVar[] list,
IntVar sum)
It constructs sum constraint which sums all variables and makes it equal to variable sum. |
|
| Method Summary | |
|---|---|
java.util.ArrayList<Var> |
arguments()
It returns the variables in a scope of the constraint. |
void |
consistency(Store store)
It is a (most probably incomplete) consistency function which removes the values from variables domains. |
int |
getConsistencyPruningEvent(Var var)
It retrieves the pruning event which causes reevaluation of the constraint. |
Constraint |
getGuideConstraint()
It specifies a constraint which if imposed by search will enhance propagation of this constraint. |
int |
getGuideValue()
This function provides a value which if assigned to a variable returned by getGuideVariable() will enhance propagation of this constraint. |
Var |
getGuideVariable()
This function provides a variable which assigned a value returned by will enhance propagation of this constraint. |
java.lang.String |
id()
It gives the id string of a constraint. |
void |
impose(Store store)
It imposes the constraint in a given store. |
void |
increaseWeight()
It increases the weight of the variables in the constraint scope. |
void |
removeConstraint()
It removes the constraint by removing this constraint from all variables. |
boolean |
satisfied()
It checks if the constraint is satisfied. |
void |
supplyGuideFeedback(boolean feedback)
This function allows to provide a guide feedback. |
java.lang.String |
toString()
It produces a string representation of a constraint state. |
| Methods inherited from class JaCoP.constraints.Constraint |
|---|
cleanAfterFailure, decompose, impose, imposeDecomposition, numberArgs, queueVariable, removeLevel, removeLevelLate, requiresMonotonicity, setConsistencyPruningEvent |
| Methods inherited from class JaCoP.constraints.DecomposedConstraint |
|---|
auxiliaryVariables, imposeDecomposition |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public IntVar[] list
public IntVar sum
public static java.lang.String[] xmlAttributes
| Constructor Detail |
|---|
public Sum(IntVar[] list,
IntVar sum)
list - sum -
public Sum(java.util.ArrayList<? extends IntVar> list,
IntVar sum)
list - variables being summed up.sum - the sum variable.| Method Detail |
|---|
public java.util.ArrayList<Var> arguments()
Constraint
arguments in class Constraintpublic void consistency(Store store)
Constraint
consistency in class Constraintstore - constraint store within which the constraint consistency is being checked.public int getConsistencyPruningEvent(Var var)
Constraint
getConsistencyPruningEvent in class Constraintvar - variable for which pruning event is retrieved
public java.lang.String id()
Constraint
id in class Constraintpublic void impose(Store store)
Constraint
impose in class Constraintstore - the constraint store to which the constraint is imposed to.public void removeConstraint()
Constraint
removeConstraint in class Constraintpublic boolean satisfied()
Constraint
satisfied in class Constraintpublic java.lang.String toString()
Constraint
toString in class Constraintpublic Constraint getGuideConstraint()
Constraint
getGuideConstraint in class Constraintpublic int getGuideValue()
Constraint
getGuideValue in class Constraintpublic Var getGuideVariable()
Constraint
getGuideVariable in class Constraintpublic void supplyGuideFeedback(boolean feedback)
Constraint
supplyGuideFeedback in class Constraintfeedback - true if the guide was useful, false otherwise.public void increaseWeight()
Constraint
increaseWeight in class Constraint
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||