Here are the steps to create a new algorithm.
- Create your
CustomAlgorithm
andCustomAlgorithmConfig
following the example inalgorithms/customalgorithm.py
. These will be the algorithm code and an associated dataclass to validate loaded configs. - Create a
customalgorithm.yaml
with the configuration parameters you defined in your script. Make sure it hascustomalgorithm_config
within its defaults at the top of the file to let hydra know which python dataclass it is associated to. You can seeconf/algorithm/customalgorithm.yaml
for an example. - Place your algorithm script in
benchmarl/algorithms
and your config inbenchmarl/conf/algorithm
(or any other place you want to override from) - Add
{"customalgorithm": CustomAlgorithmConfig}
to thebenchmarl.algorithms.algorithm_config_registry
- Load it with
python benchmarl/run.py algorithm=customalgorithm task=...