Configuration
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 Framework
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 LaunchConfig, likewise will recordings and a copy of the configuration of the experiment stored in this folder.
Launching Customized Experiments
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=leaderboardselects 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=trueoverrides 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 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
nullforNonevalues,Nonewill be treated as a literal string.
See also
For more information about the command line syntax refer to Hydra override grammar.
Launch Config
See also LaunchConfig
Agent Config vs. Context Config
The context config is a temporary clone of the agent’s con
Agent Config |
Context Config |
|---|---|
|
|
permanent |
temporary |
updatable by actions manually |
automatically updated by |
creates the context config |
used to calculate the VehicleControls |