Module org.cicirello.chips_n_salsa
Class BinPacking.UniformRandom
java.lang.Object
org.cicirello.search.problems.binpack.BinPacking
org.cicirello.search.problems.binpack.BinPacking.UniformRandom
- All Implemented Interfaces:
IntegerCostOptimizationProblem<Permutation>
,Problem<Permutation>
- Enclosing class:
- BinPacking
Generates instances of the Bin Packing problem with item sizes that are generated uniformly at
random.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.cicirello.search.problems.binpack.BinPacking
BinPacking.Triplet, BinPacking.UniformRandom
-
Constructor Summary
ConstructorDescriptionUniformRandom
(int numItems) Generates a random instance of the Bin Packing problem, with a default bin capacity of 150, and with item sizes generated uniformly at random from the interval [20, 100].UniformRandom
(int numItems, int capacity, int minSize, int maxSize) Generates a random instance of the Bin Packing problem, with item sizes generated uniformly at random from a specified interval.UniformRandom
(int numItems, int capacity, int minSize, int maxSize, long seed) Generates a random instance of the Bin Packing problem, with item sizes generated uniformly at random from a specified interval.UniformRandom
(int numItems, long seed) Generates a random instance of the Bin Packing problem, with a default bin capacity of 150, and with item sizes generated uniformly at random from the interval [20, 100]. -
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
-
UniformRandom
public UniformRandom(int numItems) Generates a random instance of the Bin Packing problem, with a default bin capacity of 150, and with item sizes generated uniformly at random from the interval [20, 100]. These are the defaults of the uniform instances from the OR-Library.- Parameters:
numItems
- The number of items.- Throws:
NegativeArraySizeException
- if numItems is negative.
-
UniformRandom
public UniformRandom(int numItems, long seed) Generates a random instance of the Bin Packing problem, with a default bin capacity of 150, and with item sizes generated uniformly at random from the interval [20, 100]. These are the defaults of the uniform instances from the OR-Library.- Parameters:
numItems
- The number of items.seed
- The seed for the random number generator to enable reproducible problem instances.- Throws:
NegativeArraySizeException
- if numItems is negative.
-
UniformRandom
public UniformRandom(int numItems, int capacity, int minSize, int maxSize) Generates a random instance of the Bin Packing problem, with item sizes generated uniformly at random from a specified interval.- Parameters:
numItems
- The number of items.capacity
- The bin capacity.minSize
- The minimum size for items.maxSize
- The maximum size for items.- Throws:
IllegalArgumentException
- if minSize is greater than maxSize.NegativeArraySizeException
- if numItems is negative.
-
UniformRandom
public UniformRandom(int numItems, int capacity, int minSize, int maxSize, long seed) Generates a random instance of the Bin Packing problem, with item sizes generated uniformly at random from a specified interval.- Parameters:
numItems
- The number of items.capacity
- The bin capacity.minSize
- The minimum size for items.maxSize
- The maximum size for items.seed
- The seed for the random number generator to enable reproducible problem instances.- Throws:
IllegalArgumentException
- if minSize is greater than maxSize.NegativeArraySizeException
- if numItems is negative.
-