inet.simulation.task¶
This module provides abstractions for simulation tasks and their results.
Classes¶
Represents multiple simulation tasks that can be run together. |
|
Represents a simulation task that can be run as a separate process or in the process where Python is running. |
|
Represents a simulation task result that is collected when a simulation task is run. |
Functions¶
|
Cleans the results folders for the simulation configs matching the provided filter criteria. |
|
Returns multiple simulation tasks matching the filter criteria. The returned tasks can be run by calling the |
|
Runs one or more simulations that match the provided filter criteria. The simulations can be run sequentially or |
Module Contents¶
-
inet.simulation.task.clean_simulation_results(simulation_project=
None, simulation_configs=None, **kwargs)¶ Cleans the results folders for the simulation configs matching the provided filter criteria.
- Parameters:¶
- simulation_project=
None¶ The simulation project from which simulation tasks are collected. If not specified then the default simulation project is used.
- simulation_configs=
None¶ The list of simulation configurations from which the simulation tasks are collected. If not specified then all simulation configurations are used.
- kwargs : dict¶
Additional parameters are inherited from the
get_simulation_configsfunction.
- simulation_project=
- Returns (None):
nothing.
-
inet.simulation.task.get_simulation_tasks(simulation_project=
None, simulation_configs=None, mode=None, debug=None, break_at_event_number=None, break_at_matching_event=None, run_number=None, run_number_filter=None, exclude_run_number_filter=None, sim_time_limit=None, cpu_time_limit=None, concurrent=True, expected_num_tasks=None, simulation_task_class=SimulationTask, multiple_simulation_tasks_class=MultipleSimulationTasks, **kwargs)¶ Returns multiple simulation tasks matching the filter criteria. The returned tasks can be run by calling the
runmethod.- Parameters:¶
- simulation_project=
None¶ The simulation project from which simulation tasks are collected. If not specified then the default simulation project is used.
- simulation_configs=
None¶ The list of simulation configurations from which the simulation tasks are collected. If not specified then all simulation configurations are used.
- mode : string¶
Determines the build mode for the simulation project before running any of the returned simulation tasks. Valid values are “debug” and “release”.
- debug : bool¶
Specifies that the IDE debugger should be attached to the running simulation.
- break_at_event_number : int¶
Specifies an event number at which a breakpoint is to be set.
- break_at_matching_event : string¶
Specifies a C++ expression at which a breakpoint is to be set.
- run_number : int or None¶
The simulation run number of all returned simulation tasks. If not specified, then this filter criteria is ignored.
- run_number_filter : string or None¶
A regular expression that matches the simulation run number of the returned simulation tasks. If not specified, then this filter criteria is ignored.
- exclude_run_number_filter : string or None¶
A regular expression that does not match the simulation run number of the returned simulation tasks. If not specified, then this filter criteria is ignored.
- sim_time_limit : string or None¶
The simulation time limit of the returned simulation tasks. If not specified, then the value in the simulation configuration is used.
- cpu_time_limit : string or None¶
The CPU processing time limit of the returned simulation tasks. If not specified, then the value in the simulation configuration is used.
- concurrent : bool¶
Specifies if collecting simulation configurations and simulation tasks is done sequentially or concurrently.
- expected_num_tasks : int¶
The number of tasks that is expected to be returned. If the result doesn’t match an exception is raised.
- simulation_task_class : type¶
Determines the Python class of the returned simulation task objects.
- multiple_simulation_tasks_class : type¶
Determines the Python class of the returned multiple simulation tasks object.
- kwargs : dict¶
Additional parameters are inherited from the
matches_filtermethod and also from theSimulationTaskandMultipleSimulationTasksconstructors.
- simulation_project=
- Returns (
MultipleSimulationTasks): An object that contains a list of
SimulationTaskmatching the filter criteria. Each simulation task describes a simulation that can be run (and re-run) without providing additional parameters.
- inet.simulation.task.run_simulations(**kwargs)¶
Runs one or more simulations that match the provided filter criteria. The simulations can be run sequentially or concurrently on a single computer or on an SSH cluster. Besides, the simulations can be run as separate processes and also in the same Python process loading the required libraries.
- Parameters:¶
- kwargs : dict¶
Additional parameters are inherited from the
get_simulation_tasks()function and also from theMultipleSimulationTasks.run()method.
- Returns (
MultipleTaskResults): an object that contains a list of
SimulationTaskResultobjects. Each object describes the results of running one simulation.