Class ALPDecision

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

public class ALPDecision extends Object
Represents a decision in the Aircraft Landing Problem (ALP).

This decision consists of assigning an aircraft of a given class to a specific runway. The actual aircraft chosen is determined by:

  • The state: the number of remaining aircraft of that class.
  • The problem: an ordered list (by target arrival time) of aircraft per class.
  • The remaining aircraft count acts as the index into the ordered list to select the specific aircraft.

Instances of this class are immutable with respect to their aircraftClass and runway values. Equality and hash code are defined based on these two fields.

See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    int
    The class of the aircraft being assigned.
    int
    The runway to which the aircraft is assigned.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ALPDecision(int aircraftClass, int runway)
    Constructs a new decision assigning an aircraft of the given class to the given runway.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Checks whether this decision is equal to another object.
    int
    Computes the hash code of this decision based on the aircraft class and runway.

    Methods inherited from class java.lang.Object

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

    • aircraftClass

      public int aircraftClass
      The class of the aircraft being assigned.
    • runway

      public int runway
      The runway to which the aircraft is assigned.
  • Constructor Details

    • ALPDecision

      public ALPDecision(int aircraftClass, int runway)
      Constructs a new decision assigning an aircraft of the given class to the given runway.
      Parameters:
      aircraftClass - the class of the aircraft
      runway - the runway number
  • Method Details

    • equals

      public boolean equals(Object o)
      Checks whether this decision is equal to another object. Two decisions are equal if they have the same aircraft class and runway.
      Overrides:
      equals in class Object
      Parameters:
      o - the object to compare with
      Returns:
      true if the objects represent the same decision, false otherwise
    • hashCode

      public int hashCode()
      Computes the hash code of this decision based on the aircraft class and runway.
      Overrides:
      hashCode in class Object
      Returns:
      the hash code