Package org.ddolib.examples.alp
Class ALPState
java.lang.Object
org.ddolib.examples.alp.ALPState
Represents the state of the Aircraft Landing Problem (ALP) at a given moment.
An ALPState encapsulates:
- The number of remaining aircraft to land for each aircraft class.
- The current state of each runway, including the class of the last landed aircraft and its landing time.
Instances of this class are immutable through the copy constructor and can be
compared using equals(Object) and hashCode().
-
Field Summary
FieldsModifier and TypeFieldDescriptionint[]Number of remaining aircraft for each class.State of each runway, including last landed aircraft class and landing time. -
Constructor Summary
ConstructorsConstructorDescriptionALPState(int[] remainingAircraft, RunwayState[] runwayStates) Constructs a new ALP state with the given remaining aircraft and runway states.Copy constructor: creates a deep copy of anotherALPState. -
Method Summary
-
Field Details
-
remainingAircraftOfClass
public int[] remainingAircraftOfClassNumber of remaining aircraft for each class. -
runwayStates
State of each runway, including last landed aircraft class and landing time.
-
-
Constructor Details
-
ALPState
Constructs a new ALP state with the given remaining aircraft and runway states.- Parameters:
remainingAircraft- the array representing remaining aircraft per classrunwayStates- the array representing the state of each runway
-
ALPState
Copy constructor: creates a deep copy of anotherALPState.- Parameters:
other- the state to copy
-
-
Method Details
-
equals
Checks if two ALP states are equal.Two states are considered equal if they have the same remaining aircraft per class and identical runway states.
-
hashCode
public int hashCode()Computes the hash code for this state, based on remaining aircraft and runway states. -
toString
Returns a string representation of the ALP state.
-