A core element behind the agent is it's flexible and dynamic configuration. Loaded is the configuration from YAML files (conf/
) with the help of the Hydra library, which in turn builds upon the flexible DictConfig
from the omegaconf library.
The entry point to the configuration is the conf/launch_config.yaml
file. Which defines high-level settings for the simulator and user-interface.
Hydra allows to manage the configuration in a flexible way. Configuration files are composed hierarchically from multiple sources. The different configuration options can be specified or overridden from the command line.
Additionally, Hydra also tracks and logs the output of experiments, for example each output of a run is stored in the outputs folder configured by hydra.run.dir
in the {py:class}.LaunchConfig
, likewise will recordings and a copy of the configuration of the experiment stored in this folder.
Experiments with different configurations can launched over the command line like:
python AgentGameLoop.py \
agent=leaderboard \
experiments=[sync_on,fast_driver] \
agent.ignore_traffic_lights=true
In the script is a with @hydra.main
decorated main function that loads the configuration in the following way:
agent=leaderboard
selects the main configuration from conf/agent/leaderboard.yaml. Default: conf/agent/default_settings.yaml.experiments=[sync_on,fast_driver]
merges the smaller configurations from conf/experiments/sync_on.yaml and conf/experiments/fast_driver.yaml on top.agent.ignore_traffic_lights=true
overrides a single option.
The order of the command line arguments do not matter. The resolution order picked from the conf/ directory is:
- launch_config.yaml
- agent/
- config_extensions/camera.yaml
- config_extension/job_logging.yaml
- experiments
- single command line overrides
:::{attention}
The {py:meth}.GameFramework.quickstart
method is currently not available when using @hydra.main
.
:::
:::{danger} Caveats
- It is important to not leave any spaces around the
=
sign and the arguments that follow. - Use
null
forNone
values,None
will be treated as a literal string.
:::
:::{seealso}
For more information about the command line syntax refer to Hydra override grammar.
:::
See also {py:class}.LaunchConfig
The context config is a temporary clone of the agent's con
Agent Config | Context Config |
---|---|
agent.config |
ctx.config |
permanent | temporary |
updatable by actions manually | automatically updated by {py:attr}.Rule.overwrite_settings |
creates the context config | used to calculate the VehicleControls |