smarts.sstudio.sstypes.bubble module
- class smarts.sstudio.sstypes.bubble.Bubble(zone: ~smarts.sstudio.sstypes.zone.Zone, actor: ~smarts.sstudio.sstypes.actor.social_agent_actor.SocialAgentActor | ~smarts.sstudio.sstypes.actor.traffic_engine_actor.TrafficEngineActor, margin: float = 2, limit: ~smarts.sstudio.sstypes.bubble_limits.BubbleLimits | None = None, exclusion_prefixes: ~typing.Tuple[str, ...] = <factory>, id: str = <factory>, follow_actor_id: str | None = None, follow_offset: ~typing.Tuple[float, float] | None = None, keep_alive: bool = False, follow_vehicle_id: str | None = None, active_condition: ~smarts.sstudio.sstypes.condition.Condition = LiteralCondition(literal=<ConditionState.TRUE: 4>), airlock_condition: ~smarts.sstudio.sstypes.condition.Condition = LiteralCondition(literal=<ConditionState.TRUE: 4>))[source]
A descriptor that defines a capture bubble for social agents.
Bubbles consist of an airlock and hijack zone. The airlock is always the same size or larger than the hijack zone. A vehicle must first pass into the airlock and pass the conditions of the airlock to be considered by the hijack zone.
- active_condition: Condition = LiteralCondition(literal=<ConditionState.TRUE: 4>)
Conditions that determine if the bubble is enabled.
- actor: SocialAgentActor | TrafficEngineActor
The actor specification that this bubble works for.
- airlock_condition: Condition = LiteralCondition(literal=<ConditionState.TRUE: 4>)
This condition is used to determine if an actor is allowed into the bubble airlock.
- exclusion_prefixes: Tuple[str, ...]
Used to exclude social actors from capture.
- follow_actor_id: str | None = None
Actor ID of agent we want to pin to. Doing so makes this a “traveling bubble” which means it moves to follow the follow_actor_id’s vehicle. Offset is from the vehicle’s center position to the bubble’s center position.
- follow_offset: Tuple[float, float] | None = None
Maintained offset to place the traveling bubble relative to the follow vehicle if it were facing north.
- follow_vehicle_id: str | None = None
Vehicle ID of a vehicle we want to pin to. Doing so makes this a “traveling bubble” which means it moves to follow the follow_vehicle_id’s vehicle. Offset is from the vehicle’s center position to the bubble’s center position.
- id: str
- property is_boid
Tests if the actor is to control multiple vehicles.
- keep_alive: bool = False
If enabled, the social agent actor will be spawned upon first vehicle airlock and be reused for every subsequent vehicle entering the bubble until the episode is over.
- limit: BubbleLimits | None = None
The maximum number of actors that could be captured. If limit != None it will only allow that specified number of vehicles to be hijacked. N.B. when actor = BoidAgentActor the lesser of the actor capacity and bubble limit will be used.
- margin: float = 2
The exterior buffer area that extends the air-locking zone area. Must be >= 0.
- static to_actor_id(actor, mission_group)[source]
Mashes the actor id and mission group to create what needs to be a unique id.
- property traffic_provider: str | None
The name of the traffic provider used if the actor is to be controlled by a traffic engine.
- Returns:
The name of the traffic provider or None.
- Return type:
(Optional[str])