|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.intranet.sim.ModelElement
org.intranet.elevator.model.operate.Person
A Person moves around the building, calling elevators, entering elevators, and leaving elevators. Person states:
State | Variables | Transitions | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
destination | currentLocation | setDestination() | CarRequestPanel [arrivedUp/Down] |
Door [doorClosed] |
Car [docked] |
Door [doorOpened] |
[leftCar] | ||||||
Idle | null | Set | Idle if destination is same pressButton(): Waiting if elevator is elsewhere enterCar(): Travelling if elevator is there |
Impossible | Impossible | Impossible | Impossible | Impossible | |||||
Waiting | Set | Set to Floor | Illegal? | enterCar(): Travelling if success waitForDoorClose(): DoorClosing if car is full |
Impossible | Impossible | Impossible | Impossible | |||||
DoorClosing | Set | Set to Floor | Illegal? | Impossible | doorClosed(): Waiting via pressedUp/Down() | Impossible | Impossible | Impossible | |||||
Travelling | Set | Set to Car | Illegal? | Impossible | Impossible | waitForDoorOpen(): DoorOpening | Impossible | Impossible | |||||
DoorOpening | Set | Set to Car | Illegal? | Impossible | Impossible | Impossible | leaveCar(): LeavingCar | Impossible | |||||
LeavingCar | Set | Set to Car | Illegal? | Impossible | Impossible | Impossible | Impossible | Idle | |||||
Moving | Set | ?? | Illegal | Impossible | Impossible: Door is obstructed | Impossible | Impossible | Impossible |
Field Summary | |
private CarRequestPanel.ArrivalListener |
arrivalListener
|
private Location |
currentLocation
|
private Floor |
destination
|
private java.util.Map |
doorListenerMap
|
private int |
percentMoved
|
private java.util.Map |
sensorListenerMap
|
private long |
startTravelTime
|
private long |
startWaitTime
|
private long |
totalTravelTime
|
private long |
totalWaitingTime
|
Fields inherited from class org.intranet.sim.ModelElement |
eventQueue |
Constructor Summary | |
(package private) |
Person(EventQueue eQ,
Location startLocation)
|
Method Summary | |
private void |
beginEnterCar(CarEntrance entrance)
|
private void |
beginTravel()
|
private void |
beginWaiting()
|
private void |
endTravel()
|
private void |
endWaiting()
|
private void |
enterCar(CarEntrance carEntrance)
The person enters the car through the specified entrance. |
Floor |
getDestination()
|
int |
getPercentMoved()
|
long |
getTotalTime()
|
long |
getTotalTravelTime()
|
long |
getTotalWaitingTime()
|
private void |
leaveCar()
When a person arrives at the destination, this is all the processing that has to happen. |
private void |
movePerson(Location destination)
Move the person to the specified destination. |
private void |
payAttentionToEntrance(CarEntrance entrance,
boolean up)
|
void |
setDestination(Floor newDestination)
|
private void |
startPayingAttention(boolean up)
|
private void |
stopPayingAttention()
|
private void |
tryToEnterCar(boolean up)
|
private void |
waitForDoorOpen(Door arrivalDoor)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private Floor destination
private Location currentLocation
private int percentMoved
private java.util.Map sensorListenerMap
private java.util.Map doorListenerMap
private CarRequestPanel.ArrivalListener arrivalListener
private long totalWaitingTime
private long startWaitTime
private long totalTravelTime
private long startTravelTime
Constructor Detail |
Person(EventQueue eQ, Location startLocation)
Method Detail |
public void setDestination(Floor newDestination)
private void startPayingAttention(boolean up)
private void payAttentionToEntrance(CarEntrance entrance, boolean up)
private void stopPayingAttention()
private void tryToEnterCar(boolean up)
private void beginEnterCar(CarEntrance entrance)
private void beginWaiting()
private void endWaiting()
private void beginTravel()
private void endTravel()
public long getTotalWaitingTime()
public long getTotalTravelTime()
public long getTotalTime()
public Floor getDestination()
private void leaveCar()
private void enterCar(CarEntrance carEntrance)
carEntrance
- The entrance to the car.private void movePerson(Location destination)
destination
- Where the person moves to.private void waitForDoorOpen(Door arrivalDoor)
public int getPercentMoved()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |