pantheonrl.common.agents.DummyAgent

class DummyAgent(dummy_env)[source]

Bases: Agent

Agent wrapper for standard SARL algorithms assuming a gym interface.

Warning

Users should not directly construct a Dummy Agent. Instead, use the construct_single_agent_interface method from MultiAgentEnv.

Parameters:

dummy_env – The DummyEnv associated with this DummyAgent

Methods

get_action

Return an action given an observation.

update

Add new rewards and done information if the agent can learn.

get_action(obs)[source]

Return an action given an observation.

Parameters:

obs (Observation) – The observation to use

Returns:

The action to take

Return type:

ndarray

update(reward, done)[source]

Add new rewards and done information if the agent can learn.

Each update corresponds to the most recent get_action.

If there are multiple calls to update that correspond to the same get_action, their rewards are summed up and the last done flag will be used.

Parameters:
  • reward (float) – The reward receieved from the previous action step

  • done (bool) – Whether the game is done

Return type:

None