Module org.cicirello.chips_n_salsa
Class BinPacking.Triplet
java.lang.Object
org.cicirello.search.problems.binpack.BinPacking
org.cicirello.search.problems.binpack.BinPacking.Triplet
- All Implemented Interfaces:
IntegerCostOptimizationProblem<Permutation>
,Problem<Permutation>
- Enclosing class:
- BinPacking
Generates instances of the Bin Packing problem where the optimal solution is comprised of all
full triplet bins (each bin in optimal solution has exactly 3 items that fills the bin to
capacity). The cost of the optimal solution to each such instance is one third the number of
items.
The bin capacity for the instances generated by this method is 1000. When generating the instance, each triplet is generated as follows. The size of one item is uniform at random from the interval [380, 490]. The second item's size is generated uniformly at random from [250, s/2), where s is 1000 - size of the first item. The third item for the triplet has size 1000 - s - t, where s and t are the sizes of the first two items.
The triplets, as defined above, are as described in: "A Hybrid Grouping Genetic Algorithm for Bin Packing" by Emanuel Falkenauer.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.cicirello.search.problems.binpack.BinPacking
BinPacking.Triplet, BinPacking.UniformRandom
-
Constructor Summary
-
Method Summary
Methods inherited from class org.cicirello.search.problems.binpack.BinPacking
cost, getCapacity, getSize, minCost, numItems, permutationToBinPackingSolution, value
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.cicirello.search.problems.IntegerCostOptimizationProblem
costAsDouble, getSolutionCostPair, isMinCost
-
Constructor Details
-
Triplet
public Triplet(int numItemTriplets) Generates a triplet instance of the Bin Packing Problem.- Parameters:
numItemTriplets
- The number of triplets. The number of items in the instance will equal 3 * numItemTriplets.- Throws:
NegativeArraySizeException
- if numItemTriplets is negative.
-
Triplet
public Triplet(int numItemTriplets, long seed) Generates a triplet instance of the Bin Packing Problem.- Parameters:
numItemTriplets
- The number of triplets. The number of items in the instance will equal 3 * numItemTriplets.seed
- The seed for the random number generator to enable reproducible problem instances.- Throws:
NegativeArraySizeException
- if numItemTriplets is negative.
-