public abstract class MovementModule extends java.lang.Object implements Updatable
Modifier and Type | Field and Description |
---|---|
AatomHumanAgent |
agent
The agent.
|
private Chair |
chair
The chair the agent is sitting on.
|
protected Vector |
currentVelocity
The current velocity.
|
protected double |
desiredSpeed
The desired speed.
|
protected ObservationModule |
observationModule
The observation module.
|
private double |
stopMovingTime
The time that the agent still needs to stop moving.
|
Constructor and Description |
---|
MovementModule(double desiredSpeed)
Creates a movement model.
|
Modifier and Type | Method and Description |
---|---|
protected Vector |
boundSpeed(Vector vector)
Bounds the speed of a movement to a maximum of 1.5 the desired speed.
|
Chair |
getChair()
Gets the chair the agent is sitting on.
|
Vector |
getCurrentVelocity()
Gets the current velocity.
|
double |
getDesiredSpeed()
Gets the desired speed.
|
abstract Vector |
getMove(int timeStep)
Gets the next move.
|
Position |
getPosition()
Gets the position of the agent.
|
double |
getStopMovingTime()
Get the remaining stop moving time.
|
boolean |
getStopOrder()
Indicates if the agent has a stop order.
|
void |
init(AatomHumanAgent agent,
ObservationModule observationModule)
Sets the agent.
|
boolean |
isSitting()
Determines if the agent is sitting.
|
boolean |
setSitDown(Chair chair)
Asks the agent to sit down on a specific
Chair . |
void |
setStopOrder(double stopOrder)
Sets the time that indicates if the time to stop.
|
void |
update(int timeStep)
Updates the updatable element.
|
public AatomHumanAgent agent
protected Vector currentVelocity
protected double desiredSpeed
private Chair chair
private double stopMovingTime
protected ObservationModule observationModule
public MovementModule(double desiredSpeed)
desiredSpeed
- The desired speed.protected Vector boundSpeed(Vector vector)
vector
- The movement.public double getDesiredSpeed()
public Chair getChair()
public Vector getCurrentVelocity()
public abstract Vector getMove(int timeStep)
currentVelocity
to the generated value.timeStep
- The time step (in milliseconds).public Position getPosition()
public boolean getStopOrder()
public double getStopMovingTime()
public void init(AatomHumanAgent agent, ObservationModule observationModule)
agent
- The agent.observationModule
- The observation module.public boolean isSitting()
public boolean setSitDown(Chair chair)
Chair
. Returns the
Position
of the chair if he will sit down, returns
Position.NO_POSITION
if he will not.chair
- The chair.public void setStopOrder(double stopOrder)
stopOrder
- The stopping time.