Class BinPackingSolution

java.lang.Object
org.cicirello.search.problems.binpack.BinPackingSolution

public final class BinPackingSolution extends Object
This class represents 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 solution such as number of bins, and contents of the bins.
  • Method Details

    • cost

      public final int cost()
      Gets the cost of this solution (i.e., number of bins used).
      Returns:
      solution.size();
    • getBin

      public final Bin getBin(int i)
      Gets one of the bins in this solution.
      Parameters:
      i - The id of the bin.
      Returns:
      The i-th bin in the solution.