Class ALPState

java.lang.Object
org.ddolib.examples.alp.ALPState

public class ALPState extends Object
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.
This state is used by decision diagram solvers to track the progress of the landing schedule and compute feasible transitions.

Instances of this class are immutable through the copy constructor and can be compared using equals(Object) and hashCode().

  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    int[]
    Number of remaining aircraft for each class.
    State of each runway, including last landed aircraft class and landing time.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ALPState(int[] remainingAircraft, RunwayState[] runwayStates)
    Constructs a new ALP state with the given remaining aircraft and runway states.
    Copy constructor: creates a deep copy of another ALPState.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Checks if two ALP states are equal.
    int
    Computes the hash code for this state, based on remaining aircraft and runway states.
    Returns a string representation of the ALP state.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

    • remainingAircraftOfClass

      public int[] remainingAircraftOfClass
      Number of remaining aircraft for each class.
    • runwayStates

      public RunwayState[] runwayStates
      State of each runway, including last landed aircraft class and landing time.
  • Constructor Details

    • ALPState

      public ALPState(int[] remainingAircraft, RunwayState[] runwayStates)
      Constructs a new ALP state with the given remaining aircraft and runway states.
      Parameters:
      remainingAircraft - the array representing remaining aircraft per class
      runwayStates - the array representing the state of each runway
    • ALPState

      public ALPState(ALPState other)
      Copy constructor: creates a deep copy of another ALPState.
      Parameters:
      other - the state to copy
  • Method Details

    • equals

      public boolean equals(Object o)
      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.

      Overrides:
      equals in class Object
      Parameters:
      o - the object to compare with
      Returns:
      true if the states are equal, false otherwise
    • hashCode

      public int hashCode()
      Computes the hash code for this state, based on remaining aircraft and runway states.
      Overrides:
      hashCode in class Object
      Returns:
      the hash code
    • toString

      public String toString()
      Returns a string representation of the ALP state.
      Overrides:
      toString in class Object
      Returns:
      a string showing the runway states and remaining aircraft per class