Class SMICGenrator

java.lang.Object
org.ddolib.examples.smic.SMICGenrator

public class SMICGenrator extends Object
The SMICGenrator class is responsible for generating random instances of the Single Machine with Inventory Constraint (SMIC) problem.

Each generated instance defines a set of production jobs characterized by: processing times, release dates, inventory changes (positive or negative), and an initial inventory level that satisfies the given capacity constraints.

The generator takes several tunable parameters that control the instance structure and difficulty:

  • n – number of jobs,
  • alpha – upper bound on job processing times,
  • tau – scaling factor for release dates,
  • eta – inventory scaling factor used to derive capacity limits,
  • seed – random seed for reproducibility.

The generator randomly samples job attributes and ensures feasibility by checking that the resulting initial inventory and signed inventory variations do not violate capacity constraints. If a valid instance cannot be constructed after 10000 trials, an exception is thrown.

Generation Process

  1. Sample job processing times uniformly from [1, α];
  2. Sample absolute inventory changes |Δᵢ| uniformly from [1, 10];
  3. Randomly assign each job as a production (+1) or consumption (0) job;
  4. Determine a feasible initial inventory I₀ within capacity bounds;
  5. Generate release dates uniformly from [0, τ × pᵢ];
  6. Construct a SMICProblem instance encapsulating the generated data.

Example


 SMICGenrator generator = new SMICGenrator(10, 5, 0.5, 2, 12345L);
 SMICProblem instance = generator.generate();
 System.out.println(instance);
 
See Also:
  • Constructor Details

    • SMICGenrator

      public SMICGenrator(int n, int alpha, double tau, int eta, long seed)
      Constructs a new SMIC instance generator with the given parameters.
      Parameters:
      n - the number of jobs to generate
      alpha - the upper bound for processing times
      tau - the release time scaling factor
      eta - the scaling factor for inventory capacity
      seed - the random seed for reproducibility
  • Method Details

    • generate

      public SMICProblem generate()
      Generates a random feasible SMICProblem instance based on the parameters provided at construction.

      The generator repeatedly samples job attributes and type assignments until a feasible configuration (respecting inventory capacity constraints) is found or until 10000 iterations are exceeded.

      Returns:
      a feasible SMICProblem instance
      Throws:
      RuntimeException - if no feasible configuration can be generated after 10000 attempts