Class SMICProblem
SMICProblem class represents an instance of the
Single Machine with Inventory Constraint (SMIC) scheduling problem.
In this problem, a set of jobs must be processed on a single machine, subject to release times, inventory capacity limits, and job types that either consume or produce inventory units. The objective is typically to minimize the total completion time or a related cost.
Each job is defined by:
- Its
processingtime, - Its
releasetime, - Its
type(0 = consuming, 1 = producing inventory), - Its
inventorychange (how much it consumes or produces), - Its
weight, used in objective computations (if applicable).
initInventory and must never
exceed the maximum capacity capaInventory nor drop below zero.
This class implements the Problem interface, making it compatible
with DDO (Decision Diagram Optimization) and other optimization frameworks.
It provides methods to define:
- The initial state of the problem,
- The possible transitions between states,
- The associated transition costs,
- The domain of feasible decisions at each step.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSMICProblem(String filename) Constructs aSMICProbleminstance by parsing a text file.SMICProblem(String name, int nbJob, int initInventory, int capaInventory, int[] type, int[] processing, int[] weight, int[] release, int[] inventory) Constructs aSMICProbleminstance without a known optimal value.SMICProblem(String name, int nbJob, int initInventory, int capaInventory, int[] type, int[] processing, int[] weight, int[] release, int[] inventory, Optional<Double> optimal) Constructs aSMICProbleminstance with full specification. -
Method Summary
Modifier and TypeMethodDescriptionReturns the feasible domain of jobs that can be scheduled next, given the current inventory and remaining capacity constraints.doubleevaluate(int[] solution) Given a solution such thatsolution[i]is the value of the variablex_i, returns the value of this solution and checks if the solution respects the problem's constraints.Returns the initial state of the problem, where all jobs remain to be processed and the machine starts at time 0 with the initial inventory.doubleReturns the initial objective value associated with the initial state.intnbVars()Returns the known optimal value of the problem, if available.toString()transition(SMICState state, Decision decision) Applies a decision to transition from the current state to the next.doubletransitionCost(SMICState state, Decision decision) Computes the cost associated with scheduling a job from the current state.
-
Constructor Details
-
SMICProblem
public SMICProblem(String name, int nbJob, int initInventory, int capaInventory, int[] type, int[] processing, int[] weight, int[] release, int[] inventory, Optional<Double> optimal) Constructs aSMICProbleminstance with full specification.- Parameters:
name- the name of the instancenbJob- number of jobsinitInventory- initial inventory levelcapaInventory- maximum inventory capacitytype- job types (0 = consume, 1 = produce)processing- processing times for each jobweight- weights associated with each jobrelease- release times for each jobinventory- inventory change (positive for production, negative for consumption)optimal- optional optimal objective value (if known)
-
SMICProblem
public SMICProblem(String name, int nbJob, int initInventory, int capaInventory, int[] type, int[] processing, int[] weight, int[] release, int[] inventory) Constructs aSMICProbleminstance without a known optimal value.- Parameters:
name- the name of the instancenbJob- number of jobsinitInventory- initial inventory levelcapaInventory- maximum inventory capacitytype- job types (0 = consume, 1 = produce)processing- processing times for each jobweight- weights associated with each jobrelease- release times for each jobinventory- inventory change (positive for production, negative for consumption)
-
SMICProblem
Constructs aSMICProbleminstance by parsing a text file.The file format must follow the convention:
nbJob initInventory capaInventory type_i processing_i weight_i release_i inventory_i (for each job) [optional: optimal_value]
- Parameters:
filename- the path to the problem file- Throws:
IOException- if the file cannot be read or parsed correctly
-
-
Method Details
-
toString
-
nbVars
public int nbVars() -
initialState
Returns the initial state of the problem, where all jobs remain to be processed and the machine starts at time 0 with the initial inventory.- Specified by:
initialStatein interfaceProblem<SMICState>- Returns:
- the initial
SMICState
-
initialValue
public double initialValue()Returns the initial objective value associated with the initial state.- Specified by:
initialValuein interfaceProblem<SMICState>- Returns:
- the starting value of the objective function
-
domain
Returns the feasible domain of jobs that can be scheduled next, given the current inventory and remaining capacity constraints. -
transition
Applies a decision to transition from the current state to the next.The method removes the scheduled job from the remaining set, updates the current time and adjusts inventory levels.
- Specified by:
transitionin interfaceProblem<SMICState>- Parameters:
state- the current statedecision- the job to schedule next- Returns:
- the resulting
SMICStateafter applying the decision
-
transitionCost
Computes the cost associated with scheduling a job from the current state.The cost includes any waiting time due to release constraints and the job’s processing time.
- Specified by:
transitionCostin interfaceProblem<SMICState>- Parameters:
state- the current statedecision- the decision (job) being scheduled- Returns:
- the cost of performing the transition
-
optimalValue
Returns the known optimal value of the problem, if available.Note: This value should correspond to the expected output of the solver. For maximization problems, be careful with negative values.
- Specified by:
optimalValuein interfaceProblem<SMICState>- Returns:
- an
Optionalcontaining the known optimal value, or empty if unknown
-
evaluate
Description copied from interface:ProblemGiven a solution such thatsolution[i]is the value of the variablex_i, returns the value of this solution and checks if the solution respects the problem's constraints.Note: For maximization problems, the returned value is minus the computed value.
- Specified by:
evaluatein interfaceProblem<SMICState>- Parameters:
solution- A solution of the problem.- Returns:
- The value of the input solution
- Throws:
InvalidSolutionException- If the solution does not respect problem's constraints.
-