|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--Opus5.AbstractObject
|
+--Opus5.ZeroOneKnapsackProblem.Node
| Field Summary | |
protected int |
numberPlaced
The number of items considered. |
protected int |
totalProfit
The current total profit. |
protected int |
totalWeight
The current total weight. |
protected int |
unplacedProfit
The sum of the profits of the items not yet considered. |
protected int[] |
x
Indicates which items are taken. |
| Fields inherited from interface Opus5.Solution |
copyright |
| Constructor Summary | |
ZeroOneKnapsackProblem.Node()
Constructs the root node in the solution space of this 0/1 knapsack problem. |
|
ZeroOneKnapsackProblem.Node(ZeroOneKnapsackProblem.Node node)
Copy constructor. |
|
| Method Summary | |
java.lang.Object |
clone()
Clones this object. |
protected int |
compareTo(Comparable arg)
Compares this node in the solution space with the specified comparable object. |
int |
getBound()
Returns a lower bound on the objective function for this node and all possible descendants of this node in the solution space. |
int |
getObjective()
Returns the value of the objective function for this node. |
Enumeration |
getSuccessors()
Returns a enumeration that enumerates all the successors of this node in the solution space. |
boolean |
isComplete()
Tests if this node is a complete solution. |
boolean |
isFeasible()
Tests if this node is a feasible solution. |
void |
placeNext(int value)
Places the next item into the knapsack if value is one. |
java.lang.String |
toString()
Returns a string representation of this node of the solutions space. |
| Methods inherited from class Opus5.AbstractObject |
compare, equals, isEQ, isGE, isGT, isLE, isLT, isNE |
| Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface Opus5.Comparable |
compare, isEQ, isGE, isGT, isLE, isLT, isNE |
| Field Detail |
protected int totalProfit
protected int totalWeight
protected int unplacedProfit
protected int numberPlaced
protected int[] x
| Constructor Detail |
public ZeroOneKnapsackProblem.Node()
public ZeroOneKnapsackProblem.Node(ZeroOneKnapsackProblem.Node node)
node - The given node.| Method Detail |
public java.lang.Object clone()
clone in class java.lang.Objectpublic int getObjective()
-totalProfitgetObjective in interface Solutionpublic int getBound()
-(totalProfit+unplacedProfit).getBound in interface Solutionpublic boolean isFeasible()
isFeasible in interface Solutionpublic boolean isComplete()
isComplete in interface Solutionpublic void placeNext(int value)
value is one.value - Indicates whether to place the next item into the knapsack.public java.lang.String toString()
toString in class java.lang.Objectpublic Enumeration getSuccessors()
getSuccessors in interface SolutionEnumerationprotected int compareTo(Comparable arg)
compareTo in class AbstractObjectMethodNotImplemented - Always.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||