cohydra.simulation

The simulation executable.

Classes

Simulation

The simulation runs ns-3.


class cohydra.simulation.Simulation(scenario)[source]

Bases: object

The simulation runs ns-3. The simulation is described by a Scenario which also prepares the simulation. It also takes care of preparing networks and nodes.

Do not initialize a simulation yourself. Use the Scenario instead!

Example

with scenario as simulation:
    simulation.simulate(simulation_time=60)
Parameters

scenario (Scenario) – The scenario to run the simulation with.

scenario = None

The scenario describing the simulation.

log_directory = None

The log directory for all logs

docker_client = None

A docker runtime client for checking whether there is an influxdb running for monitoring purposes.

hosts = None

All hosts of the simulation for mapping in nodes.

This can be used to modify the hosts file.

started = None

Indicates whether the simulation is started.

workflows = None

The workflows in the simulation.

Determined by the scenario.

prepare()[source]

Prepares the simulation by setting up networks and nodes.

Iterates over all networks of the scenario and preparing them.

simulate(simulation_time=None)[source]

Simulate the network.

Aborting the simulation with ctrl + C will be catched.

Parameters

simulation_time (float) – The simulation timeout in seconds. If set to None the simulation will continue until being manually aborted.

Inheritance Diagramm

Inheritance diagram of cohydra.simulation