Class Elevator

java.lang.Object
org.episteme.social.architecture.lift.Elevator
All Implemented Interfaces:
Serializable

public class Elevator extends Object implements Serializable
Represents an autonomous elevator unit within a multi-floor transportation system. It implements a collective control algorithm (also known as the SCAN or Elevator algorithm) to optimize throughput and energy usage.

Reference: Knuth, D. E. (1973). The Art of Computer Programming, Vol. 1. Fundamental Algorithms.

* @version 2.0
Since:
1.0
Author:
Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
See Also:
  • Constructor Details

    • Elevator

      public Elevator(String id, int capacity, int maxFloors)
      Initializes a new elevator cabin with a fixed capacity and operational range.
      Parameters:
      id - unique identifier for the cabin
      capacity - maximum number of passengers allowed
      maxFloors - the total number of floors served by this lift
  • Method Details

    • getId

      public String getId()
    • getCurrentFloor

      public int getCurrentFloor()
    • getState

      public Elevator.State getState()
    • getDirection

      public Elevator.Direction getDirection()
    • pressFloorButton

      public void pressFloorButton(int floor)
      Registers a request from the cabin's internal operating panel.
      Parameters:
      floor - the target destination floor index
    • hallCall

      public void hallCall(int floor, Elevator.Direction callDir)
      Registers an external hall call request from a specific floor.
      Parameters:
      floor - the floor where the call originated
      callDir - the intended travel direction (UP or DOWN)
    • tick

      public void tick()
      Advances the elevator simulation by one discrete time step. Processes motion physics, door timing, and logic transitions.
    • addPassenger

      public void addPassenger(Passenger p)
      Boards a passenger into the cabin if capacity permits.
      Parameters:
      p - the passenger attempting to board
    • getPassengerCount

      public int getPassengerCount()
      Returns:
      the number of passengers currently in the cabin
    • getCapacity

      public int getCapacity()
      Returns:
      the maximum load capacity of the cabin