com.azalient.api.sim.agents
Interface IAgent

All Superinterfaces:
IBlocker, IChangingDrawable, IDrawable, ILoopOccupier, IObstacle, IRecord, IUserData, RecordR, RecordRW, RecordW, SortableData, StoreRecordRW
All Known Subinterfaces:
IAttached, IMotor, IPerson, ITransport, IVehicle

public interface IAgent
extends ILoopOccupier, IObstacle, IUserData, StoreRecordRW, IBlocker, IChangingDrawable

An agent is the base object that moves from origin to destination in the simulation, according to the constraints defined by the network.


Field Summary
 
Fields inherited from interface com.azalient.api.sim.agents.IObstacle
ZERO_OBSTACLES
 
Fields inherited from interface com.azalient.api.a.tables.IRecord
DELETED, KEY_SEP, KEY_SEP_CHAR
 
Method Summary
 double acceleration()
          Returns the current acceleration in m/s/s
 double age()
          Returns the age of this agent, in years
 void age(double d)
          Sets the age of this agent, in years
 IAgentVision agentVision()
          Returns the agent-vision object for this agent
 boolean arrived()
          Returns true if this agent has arrived at its destination
 IAttached attached()
          Returns the primary attachment, or null if none.
 IPolygon basePolygon()
          Returns a polygon shape defining the outline of the base of the agent
 IBehaviour behaviour()
          Returns the behaviour of this agent
 void blockedBy(IBlocker that)
          [Internal] Set the blocker for this agent
 IBlocker blocker()
          Returns any blocker, or null if not currently blocked
 IXyz centre()
          Returns the (3-D) centre point location of this agent
 double creationTime()
          Returns the time of the creation of this agent, measured in seconds since midnight on the first day of simulation
 double emissionGrams(IEngine.Emission e)
          Return the total emissions for this vehicle, in grams, for the given pollutant
 void exclude(AgentEvent event)
          Exclude this agent from calls on this event
 boolean finished()
          Returns true if this agent has finished moving, which happens when it arrives, or when it is destroyed because it cannot reach its destination
 IFollowingAlgorithm followingAlgorithm()
          Returns the agent-following algorithm object for this agent
 IXyz forward()
          Returns a unit-length vector representing the forward direction of the agent
 IFreeMovingAlgorithm freeMovingAlgorithm()
          Returns the free-moving (not following) algorithm object for this agent
 boolean frozen()
          Returns true if this agent is not moving, for example, is parked
 double gradient()
          Returns the gradient at the current position, where 1.0 or 100% equals 45 degrees
 double halfLength()
          Returns the half length of this agent only, in metres, not including trailers/pushers
 double halfLengthHead()
          Returns the distance, in metres, from the centre of the main agent to the head of the group, including any pushed attachments
 double halfLengthTail()
          Returns the distance, in metres, from the centre of the main agent to the tail of the group, including any trailing attachments
 double halfWidth()
          Returns the half-width of this agent, in metres
 boolean halted()
          Returns true if this agent has been temporarily halted, for example at a barrier or toll booth
 void halted(boolean v)
          Temporarily halt this agent, for example at a barrier or toll gate
 IXyz head()
          Returns the point at the lateral centre of the head of this agent, ignoring any leading (pushed) attachment
 double headDistance()
          The distance from the start of the path of the fore-most head of the leader group, including any pushed attachments
 IXyz headGroup()
          Returns the point at the lateral centre of the head of this agent, or any leading (pushed) attachment
 double height()
          Returns the height of this agent, in metres
 void include(AgentEvent event)
          Cancel exclusion for this agent on this event
 boolean isAttached()
          Returns true if this is an attachment
 int keepSide()
          Returns the side of the path or lane preferred by this agent, where -1 = Left, +1 = Right and 0 = No Preference.
 void keepSide(int side)
          Sets the side of the path or lane preferred by this agent, where -1 = Left, +1 = Right and 0 = No Preference.
 IAgent leader()
          Returns any leader agent, for following algorithm, or null if none
 double length()
          Returns the length of this agent, in metres
 double maxAcceleration(double speed, double gradient)
          Return the maximum acceleration in m/s/s at the GIVEN speed and gradient
 double maxDeceleration(double speed, double gradient)
          (+VE Value) Return the maximum deceleration in m/s/s at the GIVEN speed and gradient
 double maxSpeedMPS()
          Maximum speed in m/s
 double minimumGap()
          Return the minimum distance from this agent to the rear of the next agent when following
 ITwig next()
          Returns the next routing twig - the exit that this agent will choose from the current twig
 IPathway nextPathway()
          Returns the next pathway for this agent
 boolean nextPathwayForward()
          Returns true if the agent is travelling in the "forward" direction on its next pathway.
 IPathPosition pathPosition()
          Returns the pathway position object calculated from this agent's current location
 IPathway pathway()
          Returns the pathway which this agent is currently following
 IXyz pathwayFarthest()
          Returns a point on the pathway ahead of this agent: the "farthest" point on the pathway that the agent will use for steering purposes
 boolean pathwayForward()
          Returns true if the agent is travelling in the "forward" direction on its current pathway.
 double perceivedHalfLengthHead()
          Returns the distance, in metres, from the centre of the main agent to the end of the safety space at head of the group, including any pushed attachments
 double perceivedHalfWidth()
          Returns the half-width of this agent plus any gap it needs to maintain its minimum separation to the next agent, in metres
 double reactionTime()
          The reaction time, in seconds, for this agent
 void reselectExit()
          (Re)-select the exit from the current route twig
 boolean selected()
          Returns true if this agent has been selected by the user, or by a plugin.
 void selected(boolean v)
          Select the agent, causing it to be highlighted in the display.
 boolean specialMaxSpeed()
          Returns true if the agent is being controlled by an external speed profile
 double speedMPS()
          Speed in m/s
 double steerFunction(double distanceOutside)
          Returns a steering value, between -1.0 and +1.0, where -1.0 means steer left, and +1.0 means steer maximum right.
 boolean steerToPathNow()
          Returns true if the agent should steer towards the pathway from its current location
 double stoppingDistance(double speedMPS)
          Return the stopping distance (metres) given a speed in m/s
 IXyz tail()
          Returns the point at the lateral centre of the tail of this agent, ignoring any trailing attachment
 double tailDistance()
          The distance from the start of the path of the rear-most tail of the leader group, including any trailing attachments
 IXyz tailGroup()
          Returns the point at the lateral centre of the tail of this agent, or any trailing attachment
 double targetSpeedMPS()
          Returns the current target speed for this agent, in m/s.
 double timeOnPathway()
          Return the time on the current pathway, in seconds
 Distance totalDistanceTravelled()
          Return the total distance travelled as a Distance object in local units
 double totalTravelDistanceMetres()
          Return the total distance travelled, in metres, from the location of release to the current location
 int totalTravelStopsCount()
          Returns the total number of stops since departure - stopping speed are defined in the calibration parameters
 double totalTravelTimeSeconds()
          Return the total travel time in seconds for this agent, since its creation, not including delay time between its scheduled departure time and the time when it was released onto the network
 boolean trackingMe()
          Returns true if this agent is the one selected for "Tracking" in the GUI
 ITrip trip()
          Returns the trip for this agent
 RecordW tripDetailRecord(IPlace dest)
          A record created by the agent if detailed trip results are requested
 ITwig twig()
          Returns the current routing twig
 IType type()
          Returns the type of this agent
 void unblock()
          [Internal] unblock this agent
 int uniqueID()
          An ID number, unique among all agents, of any type
 IXyz velocity()
          Returns the velocity of vehicle: forward unit vector multiplied by scalar speed
 double weightKG()
          Returns the weight of this agent, in KG
 double width()
          Returns the width of this agent, in metres
 boolean zombie()
          Returns true if this agent has been destroyed because it could not reach its destination
 
Methods inherited from interface com.azalient.api.sim.detection.ILoopOccupier
loops
 
Methods inherited from interface com.azalient.api.sim.agents.IObstacle
annotationPoint
 
Methods inherited from interface com.azalient.api.a.IUserData
userData, userData, userDataHashCode
 
Methods inherited from interface com.azalient.api.file.StoreRecordRW
canRename, rename, store
 
Methods inherited from interface com.azalient.api.file.RecordR
extraSet, finished, isApplicable, isEditable, set
 
Methods inherited from interface com.azalient.api.a.tables.IRecord
name
 
Methods inherited from interface com.azalient.api.file.RecordW
extraCols, extraGet, extraGetB, extraGetD, extraGetI, extraGetS, extraGetT, get, isVolatile
 
Methods inherited from interface com.azalient.api.sim.agents.IBlocker
blocked, blockerDescription, blockPointDistance, doneBlocking, nowBlocking
 
Methods inherited from interface com.azalient.api.draw.IChangingDrawable
drawChangeables
 
Methods inherited from interface com.azalient.api.draw.IDrawable
canExplode, centroid, destroy, draw, isTransparent, name, remove, removed
 

Method Detail

uniqueID

int uniqueID()
An ID number, unique among all agents, of any type

Specified by:
uniqueID in interface IObstacle

creationTime

double creationTime()
Returns the time of the creation of this agent, measured in seconds since midnight on the first day of simulation


length

double length()
Returns the length of this agent, in metres


width

double width()
Returns the width of this agent, in metres


height

double height()
Returns the height of this agent, in metres


weightKG

double weightKG()
Returns the weight of this agent, in KG


halfLength

double halfLength()
Returns the half length of this agent only, in metres, not including trailers/pushers


halfLengthTail

double halfLengthTail()
Returns the distance, in metres, from the centre of the main agent to the tail of the group, including any trailing attachments


halfLengthHead

double halfLengthHead()
Returns the distance, in metres, from the centre of the main agent to the head of the group, including any pushed attachments


perceivedHalfLengthHead

double perceivedHalfLengthHead()
Returns the distance, in metres, from the centre of the main agent to the end of the safety space at head of the group, including any pushed attachments


halfWidth

double halfWidth()
Returns the half-width of this agent, in metres


perceivedHalfWidth

double perceivedHalfWidth()
Returns the half-width of this agent plus any gap it needs to maintain its minimum separation to the next agent, in metres


keepSide

int keepSide()
Returns the side of the path or lane preferred by this agent, where -1 = Left, +1 = Right and 0 = No Preference.


keepSide

void keepSide(int side)
Sets the side of the path or lane preferred by this agent, where -1 = Left, +1 = Right and 0 = No Preference.


centre

IXyz centre()
Returns the (3-D) centre point location of this agent


forward

IXyz forward()
Returns a unit-length vector representing the forward direction of the agent


velocity

IXyz velocity()
Returns the velocity of vehicle: forward unit vector multiplied by scalar speed


headGroup

IXyz headGroup()
Returns the point at the lateral centre of the head of this agent, or any leading (pushed) attachment


tailGroup

IXyz tailGroup()
Returns the point at the lateral centre of the tail of this agent, or any trailing attachment


head

IXyz head()
Returns the point at the lateral centre of the head of this agent, ignoring any leading (pushed) attachment


tail

IXyz tail()
Returns the point at the lateral centre of the tail of this agent, ignoring any trailing attachment


pathwayFarthest

IXyz pathwayFarthest()
Returns a point on the pathway ahead of this agent: the "farthest" point on the pathway that the agent will use for steering purposes


pathPosition

IPathPosition pathPosition()
Returns the pathway position object calculated from this agent's current location


pathway

IPathway pathway()
Returns the pathway which this agent is currently following


nextPathway

IPathway nextPathway()
Returns the next pathway for this agent


speedMPS

double speedMPS()
Speed in m/s


maxSpeedMPS

double maxSpeedMPS()
Maximum speed in m/s


acceleration

double acceleration()
Returns the current acceleration in m/s/s


gradient

double gradient()
Returns the gradient at the current position, where 1.0 or 100% equals 45 degrees


maxAcceleration

double maxAcceleration(double speed,
                       double gradient)
Return the maximum acceleration in m/s/s at the GIVEN speed and gradient


maxDeceleration

double maxDeceleration(double speed,
                       double gradient)
(+VE Value) Return the maximum deceleration in m/s/s at the GIVEN speed and gradient


reactionTime

double reactionTime()
The reaction time, in seconds, for this agent


minimumGap

double minimumGap()
Return the minimum distance from this agent to the rear of the next agent when following


targetSpeedMPS

double targetSpeedMPS()
Returns the current target speed for this agent, in m/s. The target speed is the speed at which this agent would prefer to travel, in the absence of any obstacles


age

double age()
Returns the age of this agent, in years


age

void age(double d)
Sets the age of this agent, in years


agentVision

IAgentVision agentVision()
Returns the agent-vision object for this agent


followingAlgorithm

IFollowingAlgorithm followingAlgorithm()
Returns the agent-following algorithm object for this agent


freeMovingAlgorithm

IFreeMovingAlgorithm freeMovingAlgorithm()
Returns the free-moving (not following) algorithm object for this agent


leader

IAgent leader()
Returns any leader agent, for following algorithm, or null if none


attached

IAttached attached()
Returns the primary attachment, or null if none. An attachment can also have this set, if there is a chain of attachments


isAttached

boolean isAttached()
Returns true if this is an attachment


blocker

IBlocker blocker()
Returns any blocker, or null if not currently blocked


blockedBy

void blockedBy(IBlocker that)
[Internal] Set the blocker for this agent

Internal - Not recommended for use. Public as a side-effect of implementation method

unblock

void unblock()
[Internal] unblock this agent

Internal - Not recommended for use. Public as a side-effect of implementation method

arrived

boolean arrived()
Returns true if this agent has arrived at its destination


finished

boolean finished()
Returns true if this agent has finished moving, which happens when it arrives, or when it is destroyed because it cannot reach its destination


selected

boolean selected()
Returns true if this agent has been selected by the user, or by a plugin. A selected agent is highlighted in the display


zombie

boolean zombie()
Returns true if this agent has been destroyed because it could not reach its destination


halted

boolean halted()
Returns true if this agent has been temporarily halted, for example at a barrier or toll booth


frozen

boolean frozen()
Returns true if this agent is not moving, for example, is parked


steerToPathNow

boolean steerToPathNow()
Returns true if the agent should steer towards the pathway from its current location


pathwayForward

boolean pathwayForward()
Returns true if the agent is travelling in the "forward" direction on its current pathway. This is always true for lanes, but will return true on walkways if travelling in direction CD.


nextPathwayForward

boolean nextPathwayForward()
Returns true if the agent is travelling in the "forward" direction on its next pathway. T


specialMaxSpeed

boolean specialMaxSpeed()
Returns true if the agent is being controlled by an external speed profile


trackingMe

boolean trackingMe()
Returns true if this agent is the one selected for "Tracking" in the GUI


selected

void selected(boolean v)
Select the agent, causing it to be highlighted in the display.


halted

void halted(boolean v)
Temporarily halt this agent, for example at a barrier or toll gate


basePolygon

IPolygon basePolygon()
Returns a polygon shape defining the outline of the base of the agent


exclude

void exclude(AgentEvent event)
Exclude this agent from calls on this event


include

void include(AgentEvent event)
Cancel exclusion for this agent on this event


trip

ITrip trip()
Returns the trip for this agent


type

IType type()
Returns the type of this agent


behaviour

IBehaviour behaviour()
Returns the behaviour of this agent


steerFunction

double steerFunction(double distanceOutside)
Returns a steering value, between -1.0 and +1.0, where -1.0 means steer left, and +1.0 means steer maximum right. The steering function is based on the distance of the agent outside the current pathway, and other state variables held within the agent


twig

ITwig twig()
Returns the current routing twig


next

ITwig next()
Returns the next routing twig - the exit that this agent will choose from the current twig


totalTravelTimeSeconds

double totalTravelTimeSeconds()
Return the total travel time in seconds for this agent, since its creation, not including delay time between its scheduled departure time and the time when it was released onto the network


totalTravelDistanceMetres

double totalTravelDistanceMetres()
Return the total distance travelled, in metres, from the location of release to the current location


totalTravelStopsCount

int totalTravelStopsCount()
Returns the total number of stops since departure - stopping speed are defined in the calibration parameters


emissionGrams

double emissionGrams(IEngine.Emission e)
Return the total emissions for this vehicle, in grams, for the given pollutant


totalDistanceTravelled

Distance totalDistanceTravelled()
Return the total distance travelled as a Distance object in local units


timeOnPathway

double timeOnPathway()
Return the time on the current pathway, in seconds


reselectExit

void reselectExit()
(Re)-select the exit from the current route twig


tripDetailRecord

RecordW tripDetailRecord(IPlace dest)
A record created by the agent if detailed trip results are requested


tailDistance

double tailDistance()
The distance from the start of the path of the rear-most tail of the leader group, including any trailing attachments


headDistance

double headDistance()
The distance from the start of the path of the fore-most head of the leader group, including any pushed attachments


stoppingDistance

double stoppingDistance(double speedMPS)
Return the stopping distance (metres) given a speed in m/s