Provides access to data and methods related to Agents who are members of an Agent System.
|Gets the object associated with the agent.
|Accesses the social force state of the agent.
|Activates a named behavior of an agent.
|Deactivates a named behavior of an agent.
|Retrieves the set of in-proximity neighbors associated with a behavior.
|Gets access to the Agent associated with an Object.
|neighbors( string behaviorID = nullvar )
|Usually this is the name of the behavior you want to deactivate. If you do not pass this behavior in, then it will use the first activated proximity behavior it finds. If you have a reference to the behavior node, you can pass this as well, and it will return the neighbors for that behavior.
Retrieves the set of in-proximity neighbors associated with a behavior.
var neighbors = agent.neighbors("ProsimityBehavior1");
|Agent( Object object )
|An object that is a member of an agent system.
|An AGV object
Gets access to the Agent associated with an Object.
To access the Agent associated with an object, you must either use this constructor, or call Agent.System.getAgent. If an object is a member of multiple agent systems, then calling this constructor will access the first system the object is a member of. Casting from a treenode is not correct.
You should use this constructor instead of the as() casting method. Using as() on an object will not work properly.
Agent agent = Agent(object); // correct
Agent agent = object; // auto-downcast: incorrect
Agent agent = object.as(Agent); // explicit cast: incorrect