| Modifier and Type | Field and Description |
|---|---|
private boolean |
inFrontOfQueue
Determines if the agent is in front of the queue.
|
private double |
time
The time the agent is queuing.
|
activityModule, agent, map, movement, navigationModule, observations| Constructor and Description |
|---|
QueueActivity() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canStart(int timeStep)
Determines if the activity can start.
|
void |
endActivity()
Starts the activity.
|
Position |
getActivityPosition()
Gets the activity position.
|
private double |
getAngle(Position target,
Position origin)
Calculates the angle between two positions.
|
void |
goToActivity()
Sends the agent to the activity area.
|
private boolean |
inRange(double angle,
double targetAngle,
double range)
Determines if an angle is within a range of angles.
|
boolean |
isInFrontOfQueue()
Determines if the agent is in front of the queue.
|
private boolean |
isInQueue()
Determines if the agent is queuing.
|
void |
setInFrontOfQueue()
Sets the agent in front of the queue.
|
void |
startActivity()
Starts the activity.
|
void |
startActivity(double time)
Starts the activity with a specific time.
|
void |
update(int timeStep)
Updates the updatable element.
|
getActivityState, init, isFinished, isGoingToActivity, isInProgressprivate double time
private boolean inFrontOfQueue
public boolean canStart(int timeStep)
Activitypublic void endActivity()
ActivityendActivity in class Activitypublic Position getActivityPosition()
ActivitygetActivityPosition in class Activityprivate double getAngle(Position target, Position origin)
target - The target position.origin - The origin position.public void goToActivity()
ActivitygoToActivity in class Activityprivate boolean inRange(double angle,
double targetAngle,
double range)
angle - The angle.targetAngle - The target angle.range - The range.public boolean isInFrontOfQueue()
private boolean isInQueue()
public void setInFrontOfQueue()
public void startActivity()
ActivitystartActivity in class Activitypublic void startActivity(double time)
time - The time.public void update(int timeStep)
UpdatabletimeStep - The time step of the simulation (in milliseconds).