simworld.config package

Submodules

simworld.config.config_loader module

Configuration loader module for the simulation.

This module provides a configuration loading system that reads default and user configs from YAML files and provides easy access to configuration values.

class simworld.config.config_loader.Config(path: str | None = None)

Bases: object

Configuration manager for the simulation.

Loads configuration values from YAML files and provides methods to access them through dot-notation paths.

get(key_path: str, default=None)

Get a configuration value by its dot-notation path.

Args:

key_path: Dot-notation path to the configuration value (e.g., ‘traffic.num_lanes’). default: Value to return if the key is not found.

Returns:

The configuration value at the specified path, or the default value if not found.

Raises:

ValueError: If the key is not found and no default value is provided.

Module contents

Configuration management package.

This package provides functionality for loading and managing simulation configuration. It includes tools for handling configuration files and providing access to simulation parameters throughout the application.

class simworld.config.Config(path: str | None = None)

Bases: object

Configuration manager for the simulation.

Loads configuration values from YAML files and provides methods to access them through dot-notation paths.

get(key_path: str, default=None)

Get a configuration value by its dot-notation path.

Args:

key_path: Dot-notation path to the configuration value (e.g., ‘traffic.num_lanes’). default: Value to return if the key is not found.

Returns:

The configuration value at the specified path, or the default value if not found.

Raises:

ValueError: If the key is not found and no default value is provided.