Table Of Contents
Table Of Contents

inet.simulation.task

This module provides abstractions for simulation tasks and their results.

Classes

MultipleSimulationTasks

Represents multiple simulation tasks that can be run together.

SimulationTask

Represents a simulation task that can be run as a separate process or in the process where Python is running.

SimulationTaskResult

Represents a simulation task result that is collected when a simulation task is run.

Functions

clean_simulation_results([simulation_project, ...])

Cleans the results folders for the simulation configs matching the provided filter criteria.

get_simulation_tasks([simulation_project, ...])

Returns multiple simulation tasks matching the filter criteria. The returned tasks can be run by calling the

run_simulations(**kwargs)

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 (SimulationProject or None) – The simulation project from which simulation tasks are collected. If not specified then the default simulation project is used.

  • simulation_configs (List of SimulationConfig or 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_configs function.

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 run method.

Parameters:
  • simulation_project (SimulationProject or None) – The simulation project from which simulation tasks are collected. If not specified then the default simulation project is used.

  • simulation_configs (List of SimulationConfig or 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_filter method and also from the SimulationTask and MultipleSimulationTasks constructors.

Returns (MultipleSimulationTasks):

An object that contains a list of SimulationTask matching 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 the MultipleSimulationTasks.run() method.

Returns (MultipleTaskResults):

an object that contains a list of SimulationTaskResult objects. Each object describes the results of running one simulation.