Class SMICGenrator
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
- Sample job processing times uniformly from
[1, α]; - Sample absolute inventory changes |Δᵢ| uniformly from
[1, 10]; - Randomly assign each job as a production (+1) or consumption (0) job;
- Determine a feasible initial inventory
I₀within capacity bounds; - Generate release dates uniformly from
[0, τ × pᵢ]; - Construct a
SMICProbleminstance 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 Summary
ConstructorsConstructorDescriptionSMICGenrator(int n, int alpha, double tau, int eta, long seed) Constructs a new SMIC instance generator with the given parameters. -
Method Summary
Modifier and TypeMethodDescriptiongenerate()Generates a random feasibleSMICProbleminstance based on the parameters provided at construction.
-
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 generatealpha- the upper bound for processing timestau- the release time scaling factoreta- the scaling factor for inventory capacityseed- the random seed for reproducibility
-
-
Method Details
-
generate
Generates a random feasibleSMICProbleminstance 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
SMICProbleminstance - Throws:
RuntimeException- if no feasible configuration can be generated after 10000 attempts
-