dojo.policies package

Policies are the means to give agent behaviour.

Specifically, policies map observation spaces to actions and are attached to agents

class dojo.policies.BasePolicy(agent: Agent)

Bases: ABC, Generic[Action, Agent, Observation]

The BasePolicy acts as the base abstract class for all policies.

fit(*args: Any, **kwargs: dict[str, Any]) Any

Train the policy.

abstract predict(obs: Observation) list[Action]

Run the policy to get a sequence of actions.

Parameters:

obs – The observation from the environment.

Returns:

The policy actions.

Submodules

The BasePolicy acts as the base abstract class for all policies.

class dojo.policies.base_policy.BasePolicy(agent: Agent)

Bases: ABC, Generic[Action, Agent, Observation]

The BasePolicy acts as the base abstract class for all policies.

fit(*args: Any, **kwargs: dict[str, Any]) Any

Train the policy.

abstract predict(obs: Observation) list[Action]

Run the policy to get a sequence of actions.

Parameters:

obs – The observation from the environment.

Returns:

The policy actions.