API Docs for: 0.3
Show:

Agent Class

Defined in: src\sim\Agent.js:5
Module: Agent
Parent Module: CrowdSim

The agents that live in the simulation engine.

Constructor

Agent

(
  • agent
)

Defined in src\sim\Agent.js:5

Parameters:

Methods

_startPath

()

Helper to set the path start that takes into account inverse paths.

destroy

()

Destroy agent.

followPath

(
  • path
  • index
)

Defined in src\sim\Agent.js:82

Set the agent to follow a give path starting at index.

Parameters:

getAspect

() Number

Defined in src\sim\Agent.js:53

Gets the aspect property. Used for color codes could be used for other purposes

Returns:

Number:

aspect

getRadius

() Number

Defined in src\sim\Agent.js:63

Get radius

Returns:

Number:

radius

move

(
  • accel
  • stepSize
)

Moves the agent with the given accel => speed => position

Parameters:

render

()

Animate agent.

setCurrentMobility

(
  • mobility
)

Defined in src\sim\Agent.js:72

Set mobility correction applied to the current velocity

Parameters:

  • mobility Number

    factor 0.0-1.0

setTargetInContext

(
  • context
)

Defined in src\sim\Agent.js:40

Sets as the agent target the nearest point of a Context.

Parameters:

step

(
  • stepSize
)

Advances the simulation of the agent one stepSize and moves the agent to its next possition defined by the group behavior mode.

Parameters:

  • stepSize Number

    defined by the simulation step size