Class Passenger
java.lang.Object
org.episteme.social.architecture.lift.Passenger
- All Implemented Interfaces:
Serializable
Represents an individual agent utilizing a vertical transportation system.
Tracks waiting time, transit time, and movement through various logical
states of a trip.
* @version 2.0
- Since:
- 1.0
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumMovement states of the passenger agent. -
Constructor Summary
ConstructorsConstructorDescriptionPassenger(int sourceFloor, int destinationFloor) Initializes a new passenger with a specific travel intent. -
Method Summary
Modifier and TypeMethodDescriptionintgetId()intgetState()intintvoidsetElevator(Elevator elevator) voidsetState(Passenger.State state) voidtick()Advances the passenger's internal timers based on current state.toString()
-
Constructor Details
-
Passenger
public Passenger(int sourceFloor, int destinationFloor) Initializes a new passenger with a specific travel intent.- Parameters:
sourceFloor- the index of the floor where the passenger startsdestinationFloor- the index of the target floor- Throws:
IllegalArgumentException- if source and destination are identical
-
-
Method Details
-
getId
-
getSourceFloor
public int getSourceFloor() -
getDestinationFloor
public int getDestinationFloor() -
getState
-
getWaitTicks
public int getWaitTicks()- Returns:
- the number of simulation ticks spent waiting outside a cab
-
getTravelTicks
public int getTravelTicks()- Returns:
- the number of simulation ticks spent inside a cab
-
setState
-
tick
public void tick()Advances the passenger's internal timers based on current state. -
getCurrentElevator
-
setElevator
-
toString
-