pantheonrl.common.agents.Agent

class Agent[source]

Bases: ABC

Base class for all agents in multi-agent environments

Methods

get_action

Return an action given an observation.

update

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

abstract 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

abstract 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