smarts.core.agents_provider module

class smarts.core.agents_provider.AgentPhysicsProvider(sim)[source]

A provider that manages agent vehicles with Ackermann chassis, applying their actions via appropriate controllers to their chassis.

property actions: Set[ActionSpaceType]

The action spaces of the provider.

class smarts.core.agents_provider.AgentsProvider(sim)[source]

Base class for providers that manage agent actors applying their actions via appropriate controllers (to their chassis if vehicles).

property actions: Set[ActionSpaceType]

The action spaces of the provider.

property actor_ids: Iterable[str]

The set of actors that this provider manages.

Returns:

The actors this provider manages.

Return type:

Iterable[str]

add_actor(provider_actor: ActorState, from_provider: Provider | None = None)[source]

Management of the actor with state is being assigned (or transferred if from_provider is not None) to this Provider. Should only be called if can_accept_actor() has returned True.

can_accept_actor(state: ActorState) bool[source]

Whether this Provider can take control of an existing actor with state that was previously managed by another Provider. The state.role field should indicate the desired role, not the previous role.

manages_actor(actor_id: str) bool[source]

Returns True if the actor referenced by actor_id is managed by this Provider.

perform_agent_actions(agent_actions: Dict[str, Any])[source]

Applies any actions specified by agents controlling the actors managed by this provider via appropriate controllers (to their chassis if vehicles). :param agent_actions: a dictionary from each agent_id to its actions for this step.

property recovery_flags: ProviderRecoveryFlags

Flags specifying what this provider should do if it fails. (May be overridden by child classes.)

reset()[source]

Reset this provider to a pre-initialized state.

set_manager(manager: ProviderManager)[source]

Indicate the manager that this provider should inform of all actor hand-offs.

setup(scenario) ProviderState[source]

Initialize the provider with a scenario.

step(actions, dt: float, elapsed_sim_time: float) ProviderState[source]

Progress the provider to generate new actor state. :param actions: one or more valid actions from the supported action_spaces of this provider :param dt: time (in seconds) to simulate during this simulation step :type dt: float :param elapsed_sim_time: amount of time (in seconds) that’s elapsed so far in the simulation :type elapsed_sim_time: float

Returns:

State representation of all actors this manages.

Return type:

ProviderState

stop_managing(actor_id: str)[source]

Tells the Provider to stop managing the specified actor; it will be managed by another Provider now.

sync(provider_state)[source]

Synchronize with state managed by other Providers.

teardown()[source]

Clean up provider resources.

class smarts.core.agents_provider.DirectControlProvider(sim)[source]

A provider that manages agent vehicles that are under direct control. These vehicles must have a Box chassis to allow for bypassing the application of forces.

property actions: Set[ActionSpaceType]

The action spaces of the provider.

class smarts.core.agents_provider.MotionPlannerProvider(sim)[source]

A provider that reshapes agent vehicle motion to follow a motion plan.

property actions: Set[ActionSpaceType]

The action spaces of the provider.

class smarts.core.agents_provider.TrajectoryInterpolationProvider(sim)[source]

A provider used to perform trajectory interpolation on agent actors that request trajectory following.

property actions: Set[ActionSpaceType]

The action spaces of the provider.