cohydra.scenario

The blueprint for a simulation.

Classes

Scenario

The scenario is kind of a blueprint for a simulation.


class cohydra.scenario.Scenario(netanim_node_size: float = 4)[source]

Bases: object

The scenario is kind of a blueprint for a simulation.

A scenario can be used the following way:

Example

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

netanim_node_size (float) – This determines the size of a node for displaying in NetAnim.

networks = None

All networks belonging to the scenario.

workflows = None

The workflows to be executed.

simulation = None

A reference to a simulation (if running).

context = None

The Context is e.g.used for teardowns.

It is created on simulation start.

netanim_node_size = None

The size of a node (a circle) in NetAnim.

add_network(network)[source]

Add a network to be simulated.

Parameters

network (Network) – The Network to add. It will get prepared on simulation start.

add_mobility_input(mobility_input)[source]

Add a MobilityInput.

Parameters

mobility_input (MobilityInput) – The MobilityInput to add. It will get prepared on simulation start.

channels()[source]

Retrieve all channels.

Returns

All channels of all networks in the current configuration.

Return type

list of Channel

nodes()[source]

Retrieve all nodes

Returns

All nodes of all channels in the current configuration.

Return type

list of Node

workflow(func)[source]

Add a workflow to the scenario.

Parameters

func (callable) – The callable to be executed.

Inheritance Diagramm

Inheritance diagram of cohydra.scenario