benchmarl.algorithms.AlgorithmConfig

class AlgorithmConfig[source]

Bases: object

Dataclass representing an algorithm configuration. This should be overridden by implemented algorithms. Implementors should:

  1. add configuration parameters for their algorithm

  2. implement all abstract methods

get_algorithm(experiment) Algorithm[source]

Main function to turn the config into the associated algorithm

Parameters:

experiment (Experiment) – the experiment class

Returns: the Algorithm

static _load_from_yaml(name: str) Dict[str, Any][source]
classmethod get_from_yaml(path: str | None = None)[source]

Load the algorithm configuration from yaml

Parameters:

path (str, optional) – The full path of the yaml file to load from. If None, it will default to benchmarl/conf/algorithm/self.associated_class().__name__

Returns: the loaded AlgorithmConfig

abstract static associated_class() Type[Algorithm][source]

The algorithm class associated to the config

abstract static on_policy() bool[source]

If the algorithm has to be run on policy or off policy

abstract static supports_continuous_actions() bool[source]

If the algorithm supports continuous actions

abstract static supports_discrete_actions() bool[source]

If the algorithm supports discrete actions

static has_independent_critic() bool[source]

If the algorithm uses an independent critic

static has_centralized_critic() bool[source]

If the algorithm uses a centralized critic

has_critic() bool[source]

If the algorithm uses a critic