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

public static final class BinPacking.UniformRandom extends BinPacking
Generates instances of the Bin Packing problem with item sizes that are generated uniformly at random.
  • 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.