java.lang.Object
org.cicirello.search.problems.binpack.Bin
This class is used by the
BinPackingSolution
class to represent the contents of a bin in
a solution to a BinPacking
problem instance. Although you cannot construct instances of
it directly (it doesn't have a public constructor), you can use the methods of this class to
inspect the contents (i.e., which items) of the Bin.-
Method Summary
-
Method Details
-
space
public final int space()Gets the amount of space remaining in the bin.- Returns:
- the amount of remaining space
-
size
public final int size()Gets the number of items in the Bin.- Returns:
- the number of items in the Bin
-
getItem
public final int getItem(int i) Gets the id of an item in this bin.- Parameters:
i
- an index into the bin- Returns:
- the id of the item at index i.
- Throws:
IndexOutOfBoundsException
- if i is negative or greater than or equal to size()
-