smarts.core.trap_manager module
- class smarts.core.trap_manager.Trap(geometry: Polygon, mission: NavigationMission, activation_time: float, patience: float, default_entry_speed: float, entry_tactic: TrapEntryTactic)[source]
Caches geometry and temporal information to use to capture actors for social agents
- activation_time: float
The amount of time left until this trap activates.
- default_entry_speed: float
The default entry speed of a new vehicle should this trap expire.
- entry_tactic: TrapEntryTactic
The entry tactic that this trap was generated with.
- geometry: Polygon
The trap area within which actors are considered for capture.
- mission: NavigationMission
The mission that this trap should assign the captured actor.
- patience: float
Patience to wait for better capture circumstances after which the trap expires.
- class smarts.core.trap_manager.TrapManager[source]
Facilitates agent hijacking of actors
- add_trap_for_agent(agent_id: str, mission: NavigationMission, road_map: RoadMap, sim_time: float, reject_expired: bool = False) Tuple[bool, bool] [source]
Add a new trap to capture an actor for the given agent.
- Parameters:
agent_id (str) – The agent to associate to this trap.
mission (smarts.core.plan.NavigationMission) – The mission to assign to the agent and vehicle.
road_map (RoadMap) – The road map to provide information to about the map.
sim_time (float) – The current simulator time.
reject_expired (bool) – If traps should be ignored if their patience would already be expired on creation
- Returns:
If the trap was added and if the trap is already expired.
- Return type:
Tuple[bool, bool]
- reset(scenario: smarts.core.scenario.Scenario, sim: SMARTS)[source]
- Parameters:
scenario (smarts.core.smarts.SMARTS) – The scenario to initialize from.
sim – The simulation this is associated to.