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, isInProgress
private double time
private boolean inFrontOfQueue
public boolean canStart(int timeStep)
Activity
public void endActivity()
Activity
endActivity
in class Activity
public Position getActivityPosition()
Activity
getActivityPosition
in class Activity
private double getAngle(Position target, Position origin)
target
- The target position.origin
- The origin position.public void goToActivity()
Activity
goToActivity
in class Activity
private 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()
Activity
startActivity
in class Activity
public void startActivity(double time)
time
- The time.public void update(int timeStep)
Updatable
timeStep
- The time step of the simulation (in milliseconds).