smarts.zoo.registry module

smarts.zoo.registry.make(locator: str, **kwargs)[source]

Create an AgentSpec from the given locator.

In order to load a registered AgentSpec it needs to be reachable from a directory contained in the PYTHONPATH.

Parameters:
  • locator – A string in the format of ‘path.to.file:locator-name’ where the path is in the form {PYTHONPATH}[n]/path/to/file.py

  • kwargs – Additional arguments to be passed to the constructed class.

Returns:

The agent specifications needed to instantiate and configure an agent.

Return type:

AgentSpec

smarts.zoo.registry.make_agent(locator: str, **kwargs)[source]

Create an Agent from the given agent spec locator.

In order to load a registered AgentSpec it needs to be reachable from a directory contained in the PYTHONPATH.

Parameters:
  • locator – A string in the format of ‘path.to.file:locator-name’ where the path is in the form {PYTHONPATH}[n]/path/to/file.py

  • kwargs – Additional arguments to be passed to the constructed class.

Returns:

The agent and its interface.

Return type:

Tuple[Agent, AgentInterface]

smarts.zoo.registry.register(locator: str, entry_point, **kwargs)[source]

Register an AgentSpec with the zoo.

In order to load a registered AgentSpec it needs to be reachable from a directory contained in the PYTHONPATH.

Parameters:
  • locator – A string in the format of ‘locator-name’

  • entry_point – A callable that returns an AgentSpec or an AgentSpec object

For example:

register(
    locator="motion-planner-agent-v0",
    entry_point=lambda **kwargs: AgentSpec(
        interface=AgentInterface(waypoint_paths=True, action=ActionSpaceType.TargetPose),
        agent_builder=MotionPlannerAgent,
    ),
)