jupedsim.agent
#
Module Contents#
- class Agent(backing)[source]#
Represents an Agent in the simulation.
Agent objects are always retrieved from the simulation and never created directly.
Agents can be accessed with:
# a specific agent sim.agent(id) # all agents as iterator sim.agents() # agents in a specific distance to a point as iterator sim.agents_in_range(position, distance) # agents in a polygon as iterator sim.agents_in_polygon(polygon)
Note
You need to be aware that currently there are no checks done when setting properties on an Agent instance. For example it is possible to set an Agent position outside the walkable area of the Simulation resulting in a crash.
Do not use.
Retrieve agents from the simulation.
- property journey_id: int[source]#
Id of the
JourneyDescription
the agent is currently following.- Return type:
- property target: tuple[float, float][source]#
Current target of the agent.
Can be used to directly steer an agent towards the given coordinate. This will bypass the strategical and tactical level, but the operational level will still be active.
Important
If the agent is not in a Journey with a DirectSteering stage, any change will be ignored.
Important
When setting the target, the given coordinates must lie within the walkable area. Otherwise, an error will be thrown at the next iteration call.
- property model: jupedsim.models.generalized_centrifugal_force.GeneralizedCentrifugalForceModelState | jupedsim.models.collision_free_speed.CollisionFreeSpeedModelState | jupedsim.models.social_force.SocialForceModelState[source]#
Access model specific state of this agent.
- Return type:
jupedsim.models.generalized_centrifugal_force.GeneralizedCentrifugalForceModelState | jupedsim.models.collision_free_speed.CollisionFreeSpeedModelState | jupedsim.models.social_force.SocialForceModelState