|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectJaCoP.constraints.knapsack.TreeNode
JaCoP.constraints.knapsack.TreeLeaf
public final class TreeLeaf
It contains information required by the leaf node of the item tree.
| Field Summary | |
|---|---|
double |
efficiency
It specifies the efficiency of the item in the leaf. |
int |
positionInTheTree
It specifies the position in the tree. |
int |
previousMaxQ
It specifies the maximal value of quantity variable after the last consistency check. |
int |
previousMinQ
It specifies the minimal value of quantity variable after the last consistency check. |
int |
profitOfOne
It store the profit of one instance of the item stored in this leaf. |
IntVar |
quantity
It specifies the finite domain variable denoting the allowed quantity of the item, |
int |
slice
It represents the offset from the minimal value. |
int |
weightOfOne
It stores the weight of one instance of the item stored in this leaf. |
| Fields inherited from class JaCoP.constraints.knapsack.TreeNode |
|---|
left, leftNeighbor, parent, right, rightNeighbor |
| Constructor Summary | |
|---|---|
TreeLeaf(IntVar quantity,
int weight,
int profit,
int positionInTheTree)
It creates a leaf in the tree of items. |
|
| Method Summary | |
|---|---|
double |
getEfficiency()
It returns computed beforehand the efficiency of the item stored in this tree leaf. |
int |
getProfitOfOne()
|
int |
getPSum()
It does not recompute sum of profits. |
IntVar |
getVariable()
|
int |
getWeightOfOne()
|
int |
getWMax()
It does not recompute the maximum of weights. |
int |
getWSum()
It does not recompute sum of weights. |
boolean |
hasMaxChanged()
Used to know the changes that occurred |
boolean |
hasMinChanged()
Used to know the changes that occurred |
boolean |
isLeaf()
|
int |
lastIncreasedOfMin()
Used to know the changes that occurred |
int |
max()
|
int |
min()
|
java.lang.String |
nodeToString()
It generates description of the node only. |
void |
recomputeDown(Tree tree)
This function recomputes the attributes of this node after recomputing the left and right subtree. |
void |
recomputeUp(Tree tree)
This function is used to recompute the attributes of all nodes on the way to root from this node. |
java.lang.String |
toString()
|
void |
updateInternalValues(Tree tree)
Only used in removeLevelLate(), update the internal value like previous and slice. |
| Methods inherited from class JaCoP.constraints.knapsack.TreeNode |
|---|
setLeftNeighbor, setRightNeighbor |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public final IntVar quantity
public final double efficiency
public int previousMaxQ
public int previousMinQ
public final int weightOfOne
public final int profitOfOne
public int slice
public int positionInTheTree
| Constructor Detail |
|---|
public TreeLeaf(IntVar quantity,
int weight,
int profit,
int positionInTheTree)
quantity - finite domain variable specifying the quantity.weight - it specifies the weight of one instance of the item.profit - it specifies the profit of one instance of the item.positionInTheTree - it specifies the position in the tree.| Method Detail |
|---|
public final IntVar getVariable()
public int getProfitOfOne()
public int getWeightOfOne()
public final boolean hasMinChanged()
public final int lastIncreasedOfMin()
public final boolean hasMaxChanged()
public final int getWMax()
TreeNode
getWMax in class TreeNodepublic final int getWSum()
TreeNode
getWSum in class TreeNodepublic final int getPSum()
TreeNode
getPSum in class TreeNodepublic final boolean isLeaf()
isLeaf in class TreeNodepublic final double getEfficiency()
public final java.lang.String toString()
toString in class TreeNodepublic final java.lang.String nodeToString()
TreeNode
nodeToString in class TreeNodepublic void updateInternalValues(Tree tree)
tree - it specifies the tree to which this leaf belongs too.public final int min()
public final int max()
public void recomputeDown(Tree tree)
TreeNode
recomputeDown in class TreeNodetree - It is required by leaves so tree atributes like alreadyUsedCapacity are properly updated.public void recomputeUp(Tree tree)
TreeNode
recomputeUp in class TreeNodetree - only added to be in agreement with the function template
for leaf which need information about tree it belongs to.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||