Class PSState
java.lang.Object
org.ddolib.examples.pigmentscheduling.PSState
Represents a state in the Production Scheduling Problem (PSP).
Each PSState captures the scheduling situation at a given time slot,
including which item is scheduled next and the remaining demands for all item types.
This class is immutable in practice, with the exception of cloning for safe transitions.
Fields:
t: the current time slot (counting down from the horizon).next: the item type scheduled for production at timet+1. A value of-1indicates that the next item is not yet assigned.previousDemands: an array wherepreviousDemands[i]stores the latest time beforetwhen a demand for itemioccurs. A value of-1indicates that there are no remaining demands for that item.
This class overrides hashCode(), equals(Object), and toString()
to allow proper usage in hash-based collections, state comparison, and debugging output.
PSState is used in combination with PSProblem, PSRelax, and
PSFastLowerBound in Dynamic Decision Optimization (DDO) or A* search frameworks.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPSState(int t, int next, int[] previousDemands) Constructs a new state for the PSP. -
Method Summary
Modifier and TypeMethodDescriptionprotected PSStateclone()Creates a deep copy of this state.booleanCompares this state with another object for equality.inthashCode()Computes a hash code for the state, based on time, next item, and previous demands.toString()Returns a string representation of the state, including current time, next item, and previous demands for debugging purposes.
-
Constructor Details
-
PSState
public PSState(int t, int next, int[] previousDemands) Constructs a new state for the PSP.- Parameters:
t- the current time slotnext- the next item type scheduled for production, -1 if unknownpreviousDemands- an array indicating, for each item type, the last time a demand occurs before t
-
-
Method Details
-
clone
Creates a deep copy of this state. -
hashCode
public int hashCode()Computes a hash code for the state, based on time, next item, and previous demands. -
equals
Compares this state with another object for equality. TwoPSStateinstances are equal if they have the same time, next item, and previous demand array. -
toString
Returns a string representation of the state, including current time, next item, and previous demands for debugging purposes.
-