Provides access to data and methods related to Agents who are members of an Agent System.
|object||Gets the object associated with the agent.|
|socialForce||Accesses the social force state of the agent.|
|activateBehavior||Activates a named behavior of an agent.|
|deactivateBehavior||Deactivates a named behavior of an agent.|
|neighbors||Retrieves the set of in-proximity neighbors associated with a behavior.|
|Agent||Gets access to the Agent associated with an Object.|
|neighbors( string behaviorID = nullvar )|
|behaviorID||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");
|static Agent Agent( Object object )|
|object||An object that is a member of an agent system.|
|Agent||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