torchdrivesim.behavior.iai

Classes

IAINPCController

Base class for non-playable character controllers. It leaves the state unchanged on each step.

Functions

unpack_attributes(→ torch.Tensor)

agent_attributes_to_basic_agent_properties(→ Dict[str, ...)

agent_properties_to_agent_attributes(→ torch.Tensor)

iai_initialize(location, agent_count[, center])

iai_drive(location, agent_states, agent_attributes, ...)

Module Contents

torchdrivesim.behavior.iai.unpack_attributes(attributes) torch.Tensor[source]
torchdrivesim.behavior.iai.agent_attributes_to_basic_agent_properties(agent_attributes: torch.Tensor) Dict[str, float][source]
torchdrivesim.behavior.iai.agent_properties_to_agent_attributes(agent_properties: Dict[str, float]) torch.Tensor[source]
torchdrivesim.behavior.iai.iai_initialize(location, agent_count, center=(0, 0), traffic_light_state_history: List[Dict[int, invertedai.common.TrafficLightState]] | None = None)[source]
torchdrivesim.behavior.iai.iai_drive(location: str, agent_states: torch.Tensor, agent_attributes: torch.Tensor, recurrent_states: List[invertedai.common.RecurrentState], traffic_lights_states: Dict[int, invertedai.common.TrafficLightState] | None = None)[source]
class torchdrivesim.behavior.iai.IAINPCController(npc_size, npc_state, npc_lr, location, drive_model_version: str | None = None, npc_present_mask: torch.Tensor | None = None, time: int = 0, npc_types: torch.Tensor | None = None, agent_type_names: List[str] | None = None, traffic_light_controller: torchdrivesim.traffic_lights.TrafficLightController | None = None, light_states_all_timesteps: List[Dict[int, invertedai.common.TrafficLightState]] | None = None, spawn_controller: torchdrivesim.simulator.SpawnController | None = None)[source]

Bases: torchdrivesim.simulator.NPCController

Base class for non-playable character controllers. It leaves the state unchanged on each step.

location[source]
agent_type_names = None[source]
npc_attribute[source]
recurrent_state = None[source]
drive_model_version = None[source]
npc_state_shape[source]
_traffic_light_controller = None[source]
light_states_all_timesteps = None[source]
time = 0[source]
advance_npcs(simulator: torchdrivesim.simulator.Simulator) None[source]
copy()[source]

Create a deep copy of the controller.

to(device)[source]