Simulation¶

The Simulation
class extends
HermesPy’s core distributed MonteCarlo
simulation framework to support parameterized physical layer simulations of wireless
communication and sensing scenarios.
It manages the configuration of the physical layer description represented by
SimulationScenarios
.
Once the user has configured the physical layer description,
a call to run
will launch a full
Monte Carlo simulation iterating over the configured parameter grid.
During simulation runtime, the follwing sequence of simulation stages is repeatedly executed:
Generate digital base-band signal models to be transmitted by the simulated devices
Simulate the hardware effects of devices during transmission
Realize all channel models
Propagate the device transmissions over the channel realizations
Simulate the hardware effects of devices during reception
Digitally process base-band signal models received by the simulated devices
Evaluate the configured performance metrics
- class Simulation(scenario=None, num_samples=100, drop_duration=0.0, drop_interval=inf, plot_results=False, dump_results=True, console_mode=ConsoleMode.INTERACTIVE, ray_address=None, results_dir=None, verbosity=Verbosity.INFO, seed=None, num_actors=None)[source]¶
Bases:
Pipeline
[SimulationScenario
,SimulatedDevice
],MonteCarlo
[SimulationScenario
]Executable HermesPy simulation configuration.
- Parameters:
scenario (
SimulationScenario
|None
) – The simulated scenario. If none is provided, an empty one will be initialized.num_samples (
int
) – Number of drops generated per sweeping grid section. 100 by default.drop_duration (
float
) – Duration of simulation drops in seconds.drop_interval (
float
) – Interval at which drops are being generated in seconds. If not specified, only a single drop is generated at the beginning of the simulation.plot_results (
bool
) – Plot results after simulation runs. Disabled by default.dump_results (
bool
) – Dump results to files after simulation runs. Enabled by default.console_mode (
ConsoleMode
) – Console output behaviour during execution.ray_address (
str
|None
) – The address of the ray head node. If None is provided, the head node will be launched in this machine.results_dir (
str
|None
) – Directory in which all simulation artifacts will be dropped.verbosity (
str
|Verbosity
) – Information output behaviour during execution.seed (
int
|None
) – Random seed used to initialize the pseudo-random number generator.num_actors (
int
|None
) – Number of actors to be deployed for parallel execution. If None is provided, the number of actors will be set to the number of available CPU cores.
- drop(timestamp=0.0)[source]¶
Generate a drop at a specific timestamp.
- Parameters:
timestamp (
float
) – Timestamp at which the drop is generated. Defaults to 0.0.- Return type:
- set_channel(alpha, beta, channel)[source]¶
Specify a channel within the channel matrix.
Convenience method to setting the channel of the managed of the managed
SimulationScenario
instance, which can be accessed via thescenario
property.
- property console_mode: ConsoleMode¶
Console mode during runtime.
Returns: The current console mode.
- property devices: Sequence[SimulatedDevice]¶
Sequence of all devices registered in the simulation scenario
- property drop_interval: float¶
Interval at which drops are being generated in seconds.
- Raises:
ValueError – For values smaller or equal to zero.
- dump_results: bool¶
Dump results to files after simulation runs.
- property num_samples: int¶
Number of samples per simulation grid element.
- Raises:
ValueError – If number of samples is smaller than one.
- plot_results: bool¶
Plot results after simulation runs
- property_blacklist = {'console', 'console_mode', 'scenario'}¶