Class: IconAgent

IconAgent(lat_lng, icon, agentmap)

new IconAgent(lat_lng, icon, agentmap)

Constructor for the IconAgent class, using Leaflet class system.
Parameters:
Name Type Description
lat_lng LatLng A pair of coordinates to place the iconagent at.
icon Object A Leaflet Icon instance that will depict the IconAgent.
agentmap Agentmap The agentmap instance in which the iconagent exists.
Properties:
Name Type Attributes Default Description
agentmap Agentmap The agentmap instance in which the iconagent exists.
place Place A place object specifying where the iconagent is currently at.
steps_made number <optional>
0 The number of steps the iconagent has moved since the beginning.
this.trip Object Properties detailing information about the iconagent's trip that change sometimes, but needs to be accessed by future updates.
Properties
Name Type Attributes Description
moving boolean Whether the iconagent currently moving.
paused boolean Whether the iconagent should be allowed to move along its trip.
current_point Point <nullable>
The point where the iconagent is currently located.
goal_point Point <nullable>
The point where the iconagent is traveling to.
lat_dir number <nullable>
The latitudinal direction. -1 if traveling to lower latitude (down), 1 if traveling to higher latitude (up).
lng_dir number <nullable>
The longitudinal direction. -1 if traveling to lesser longitude (left), 1 if traveling to greater longitude (right).
speed number <nullable>
The speed that the iconagent should travel, in meters per tick.
angle number <nullable>
The angle between the current point and the goal.
slope number <nullable>
The slope of the line segment formed by the two points between which the iconagent is traveling at this time during its trip.
path Array A sequence of LatLngs; the iconagent will move from one to the next, popping each one off after it arrives until the end of the street; or, until the trip is changed/reset.
controller function <nullable>
User-defined function to be called on each update (each tick).
fine_controller function <nullable>
User-defined function to be called before & after each movemnt (on each step an iconagent performs during a tick).
Source: