public class BoxProblem
extends java.lang.Object
BoxProblem
holds an instance of the problem.
All you really need here are the box dimensions, accessible
through the public variables boxX, boxY
or through
the methods getBoxX(), getBoxY()
, and
the list of items that need to be packed. You can retrieve
the entire list of items via getItems()
or an
individual item using getItem()
.Modifier and Type | Field and Description |
---|---|
int |
boxX
The horizontal dimension.
|
int |
boxY
The vertical dimension.
|
Modifier and Type | Method and Description |
---|---|
static BoxEvaluation |
evaluate(BoxProblem problem,
BoxSolution solution)
Call
evaluate to assess a potential solution to the
given problem. |
Item |
getItem(int itemNum)
Call this to get an individual item.
|
java.util.ArrayList<Item> |
getItems()
Call this to get the entire list of items
|
public int boxX
public int boxY
public java.util.ArrayList<Item> items
public java.util.ArrayList<Item> getItems()
public Item getItem(int itemNum)
public static BoxEvaluation evaluate(BoxProblem problem, BoxSolution solution)
evaluate
to assess a potential solution to the
given problem. This static method is given both the problem and
solution instances and returns an instance of BoxEvaluation
,
which has public variables to extract evaluation data.