dojo.policies

Policies are the means to give agent behaviour.

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

class BasePolicy(abc.ABC, typing.Generic[~Action, ~Agent, ~Observation]):

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

BasePolicy(agent: ~Agent)

Initialize the policy.

Parameters
  • agent: the agent associated with the policy
def fit(self, *args: Any, **kwargs: dict[str, typing.Any]) -> Any:

Train the policy.

@abstractmethod
def predict(self, obs: ~Observation) -> list[~Action]:

Run the policy to get a sequence of actions.

Parameters
  • obs: The observation from the environment.
Returns

The policy actions.