public class TrafficAgent
extends java.lang.Object
Constructor and Description |
---|
TrafficAgent(Human human,
TrafficManager manager,
double radius,
double velocityLimit)
Construct a TrafficAgent.
|
Modifier and Type | Method and Description |
---|---|
void |
beginTimestep()
Perform any pre-timestep activities required.
|
void |
clearPath()
Clear the path.
|
void |
clearPositionHistory()
Clear the position history and distance travelled.
|
void |
endTimestep()
Perform any post-timestep activities required.
|
TrafficArea |
getArea()
Get the TrafficArea the agent is currently in.
|
Point2D |
getCurrentDestination()
Get the current (possibly intermediate) destination.
|
PathElement |
getCurrentElement()
Get the current (possibly intermediate) path element.
|
Point2D |
getFinalDestination()
Get the final destination.
|
double |
getFX()
Get the total X force on this agent.
|
double |
getFY()
Get the total Y force on this agent.
|
Human |
getHuman()
Get the Human wrapped by this object.
|
double |
getMaxVelocity()
Get the maximum velocity of this agent.
|
java.util.List<PathElement> |
getPath()
Get the current path.
|
java.util.List<Point2D> |
getPositionHistory()
Get the position history.
|
double |
getRadius()
Get the radius of this agent.
|
double |
getTravelDistance()
Get the distance travelled so far.
|
double |
getVX()
Get the X velocity of this agent.
|
double |
getVY()
Get the Y velocity of this agent.
|
double |
getX()
Get the X coordinate of this agent.
|
double |
getY()
Get the Y coordinate of this agent.
|
boolean |
isMobile()
Find out if this agent is mobile.
|
void |
setLocation(double x,
double y)
Set the location of this agent.
|
void |
setMaxVelocity(double vLimit)
Set the maximum velocity of this agent.
|
void |
setMobile(boolean m)
Set whether this agent is mobile or not.
|
void |
setPath(java.util.List<PathElement> steps)
Set the path this agent wants to take.
|
void |
setPositionHistoryEnabled(boolean b)
Enable or disable position history recording.
|
void |
setPositionHistoryFrequency(int n)
Set the frequency of position history records.
|
void |
setRadius(double r)
Set the radius of this agent.
|
void |
setVerbose(boolean b)
Turn verbose logging on or off.
|
void |
step(double dt)
Execute a microstep.
|
java.lang.String |
toLongString()
Get a long version of the toString method.
|
java.lang.String |
toString() |
public TrafficAgent(Human human, TrafficManager manager, double radius, double velocityLimit)
human
- The Human wrapped by this object.manager
- The traffic manager.radius
- The radius of this agent in mm.velocityLimit
- The velicity limit.public Human getHuman()
public double getMaxVelocity()
public void setMaxVelocity(double vLimit)
vLimit
- The new maximum velocity.public TrafficArea getArea()
public java.util.List<Point2D> getPositionHistory()
public double getTravelDistance()
public void clearPositionHistory()
public void setPositionHistoryFrequency(int n)
n
- The new frequency.public void setPositionHistoryEnabled(boolean b)
b
- True to enable position history recording, false otherwise.public double getX()
public double getY()
public double getFX()
public double getFY()
public double getVX()
public double getVY()
public void setRadius(double r)
r
- The new radius in mm.public double getRadius()
public void setPath(java.util.List<PathElement> steps)
steps
- The new path.public void clearPath()
public Point2D getFinalDestination()
public Point2D getCurrentDestination()
public PathElement getCurrentElement()
public java.util.List<PathElement> getPath()
public void setLocation(double x, double y)
x
- location xy
- location ypublic void beginTimestep()
public void step(double dt)
dt
- The amount of time to simulate in ms.public void endTimestep()
public void setMobile(boolean m)
m
- True if this agent is mobile, false otherwise.public boolean isMobile()
public void setVerbose(boolean b)
b
- True for piles of debugging output, false for smaller piles.public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toLongString()