Table Of Contents
Table Of Contents

SimulationTask

from inet.simulation.task

class SimulationTask(simulation_config=None, run_number=0, itervars=None, mode='release', user_interface='Cmdenv', sim_time_limit=None, cpu_time_limit=None, record_eventlog=None, record_pcap=None, name='simulation', task_result_class=<class 'inet.simulation.task.SimulationTaskResult'>, **kwargs)[source]

Bases: inet.common.task.Task

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

Please note that undocumented features are not supposed to be called by the user.

Parameters
  • simulation_config (SimulationConfig) – The simulation config that is used to run this simulation task.

  • run_number (number) – The number uniquely identifying the simulation run.

  • itervars (string) – The list of iteration variables.

  • mode (string) – The build mode that is used to run this simulation task. Valid values are “release”, “debug”, and “sanitize”.

  • user_interface (string) – The user interface that is used to run this simulation task. Valid values are “Cmdenv”, and “Qtenv”.

  • sim_time_limit (string) – The simulation time limit as quantity with unit (e.g. “1s”).

  • cpu_time_limit (string) – The CPU time limit as quantity with unit (e.g. “1s”).

  • record_eventlog (bool) – Specifies whether the eventlog file should be recorded or not.

  • record_pcap (bool) – Specifies whether PCAP files should be recorded or not.

  • task_result_class (type) – The Python class that is used to return the result.

  • kwargs (dict) – Additional parameters are inherited from the Task constructor.

Methods

rerun

Runs the task again.

run

Runs a simulation task by running the simulation as a child process or in the same process where Python is running.

Attributes

rerun(**kwargs)

Runs the task again.

Returns (TaskResult):

The task result.

run(**kwargs)[source]

Runs a simulation task by running the simulation as a child process or in the same process where Python is running.

Parameters
  • capture_output (bool) – Determines if the simulation standard error and standard output streams are captured into Python strings or not.

  • extra_args (list) – Additional command line arguments for the simulation executable.

  • simulation_runner (string) – Determines if the simulation is run as a separate process or in the same process where Python is running. Valid values are “subprocess” and “inprocess”.

  • simulation_runner_class (type) – The simulation runner class that is used to run the simulation. If not specified, then this is determined by the simulation_runner parameter.

Returns (SimulationTaskResult):

a simulation task result that contains the several simulation specific information and also the subprocess result if applicable.