BaseSimulation¶
-
class passengersim.driver.BaseSimulation(config: Config, output_dir: Path | None =
None)[source]¶ Bases:
ABCInitialize a BaseSimulation instance.
- Parameters:
Methods
__init__(config[, output_dir])Initialize a BaseSimulation instance.
from_yaml(filenames[, output_dir])Create a Simulation object from a YAML file.
Get a mapping of path IDs to path names.
pathclasses_for_carrier(carrier)Generator of all path classes for a given carrier.
Attributes
Generator of all demands in the simulation.
Generator of all fares in the simulation.
Access markets in the simulation.
Generator of all path classes in the simulation.
Generator of all paths in the simulation.
-
classmethod from_yaml(filenames: Path | list[Path], output_dir: Path | None =
None)[source]¶ Create a Simulation object from a YAML file.
-
__init__(config: Config, output_dir: Path | None =
None)[source]¶ Initialize a BaseSimulation instance.
- path_names()[source]¶
Get a mapping of path IDs to path names.
- Returns:
dict – Dictionary mapping path IDs to string representations of paths.
- property markets : Mapping[str, Market]¶
Access markets in the simulation.
- Returns:
Mapping[str, Market] – A mapping of market names to Market objects.
- property paths¶
Generator of all paths in the simulation.
- Returns:
generator – Generator yielding path objects from the simulation.
- property pathclasses¶
Generator of all path classes in the simulation.
- Yields:
pathclass – Path class objects from all paths in the simulation.
- pathclasses_for_carrier(carrier: str)[source]¶
Generator of all path classes for a given carrier.
- Parameters:
- carrier : str¶
The carrier name to filter path classes by.
- Yields:
pathclass – Path class objects for the specified carrier.
- property demands¶
Generator of all demands in the simulation.
- Returns:
DemandIterator – Iterator object for accessing demand data.
- property fares¶
Generator of all fares in the simulation.
- Returns:
FareIterator – Iterator object for accessing fare data.