Class LiftBuilding
java.lang.Object
org.episteme.social.architecture.lift.LiftBuilding
- All Implemented Interfaces:
Serializable
Represents a logical building structure containing a vertical transportation system.
It manages the group control logic (dispatching) and maintains passenger queues
for each floor.
Dispatching logic utilizes an Estimated Time of Arrival (ETA) calculation to minimize average waiting time.
Reference: Barney, G. C. (2003). Elevator Traffic Handbook: Theory and Practice.
* @version 2.0- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionLiftBuilding(String name, int minFloor, int maxFloor) Initializes a new building with a specific floor range. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddElevator(Elevator elevator) Integrates an elevator cabin into the building's control system.voidIntroduces a passenger into the building's waiting area.intintgetName()voidhallCall(int floor, Elevator.Direction direction) Processes a floor call from outside the elevator cabs.voidtick()Progresses the entire building simulation by one time step.
-
Constructor Details
-
LiftBuilding
Initializes a new building with a specific floor range.- Parameters:
name- common name for the buildingminFloor- the lowest floor index (e.g., -1 for basement)maxFloor- the highest floor index
-
-
Method Details
-
addElevator
Integrates an elevator cabin into the building's control system.- Parameters:
elevator- the cabin unit to add
-
hallCall
Processes a floor call from outside the elevator cabs. Selects the optimal cab based on distance and current workload (ETA heuristic).- Parameters:
floor- the floor index of the calldirection- intended direction (UP or DOWN)
-
addPassenger
Introduces a passenger into the building's waiting area.- Parameters:
p- the passenger to add
-
tick
public void tick()Progresses the entire building simulation by one time step. -
getName
-
getMinFloor
public int getMinFloor() -
getMaxFloor
public int getMaxFloor() -
getElevators
-