API Reference

Network Signal Configuration

The NetworkSim.architecture.signal module contains definitions of the control and data signals used in the ring network.

Signal Configuration

ControlSignal([id_length, control_length, …])

Constructor for control signals.

DataSignal([size, abstract])

Constructor for data signals.

Network Architecture Base Configuration

The NetworkSim.architecture.base module contains useful components for the configuration of the optical ring network hardware architecture.

Node Configuration

Node(control_signal, data_signal, network[, …])

Constructor of the individual node in the ring network

Network Configuration

Network([length, num_nodes, direction])

Constructor of the network architecture

Ring Configuration

Ring(model[, ring_id, time_unit, reversed])

Ring class to store packets on both control and data rings.

Network Architecture Setup

The NetworkSim.architecture.setup module enables integration of the network components into a complete network model.

Model Configuration

Model([control_signal, data_signal, …])

Constructor for model.

Simulation Tools

The NetworkSim.simulation.tools module contains essential tools used for the simulation.

Network Performance Analysis

get_queueing_delay(simulator)

Function to compute the queueing delay latency of the defined network.

get_service_delay(simulator)

Function to compute the service delay latency of the defined network.

get_transfer_delay(simulator[, include_pd])

Function to compute the transfer delay latency of the defined network.

get_final_batch_delay(simulator)

Function to compute mean queueing and transfer delay of the final batch in the simulation.

get_extended_run_delay(simulator)

Function to compute mean queueing and transfer delay of the extended run.

get_overall_delay(simulator)

Function to compute the mean queueing and transfer delay of a simulation.

get_final_batch_throughput(simulator)

Function to compute the mean throughput of a simulation in the final batch.

get_extended_run_throughput(simulator)

Function to compute the mean throughput of a simulation during the extended run.

get_overall_throughput(simulator)

Function to compute the overall mean throughput of a simulation.

Probability Distributions for Discrete Event Simulation

Distribution(seed[, model])

Distribution class to generate interarrival time based on the chosen distribution.

Synchronised Clocks

TransmitterDataClock([model])

Synchronised clock for all transmitter on data rings.

ReceiverDataClock([model])

Synchronised clock for all receiver on data rings.

ControlClock([model])

Synchronised clock for all transmitter and receiver on control ring.

Simulation Information

Info(simulator)

Information class to generate basic information of modules involved in the simulation.

Simulation Summary

Summary(simulator)

Summary class to generate summaries for a given simulator.

Simulation Results Plotting

Plots can also be directly generated from simulation summary.

init()

Plot environment initialisation.

plot_latency_heatmap(latency[, type, fig, …])

Plot average latency of all nodes in a simulator as a heatmap.

plot_latency_scatter(latency, node_id)

Scatter plot of latency information of one node, both as a source node and as a destination node.

plot_latency(simulator, latency[, node_id, …])

Function to plot latency information.

plot_latency_throughput(latency)

Plot latency and throughput of a simulation across time.

plot_count(packet_count[, fig, ax, title])

Plot transmission packet count as a heatmap.

plot_latency_3d(latency, type)

3d bar plot of parameters as source/destination pair.

plot_batch_throughput(simulator[, show_ci])

Plot batch throughput of simulations.

plot_analytical_simulation_latency(simulator)

Plot analytical and simulation transfer delay.

Simulation Model Loading and Saving

load_model([fname, dir])

Function to load previously saved pickle files as models.

save_model(simulator, fname[, dir, minimal])

Function to save simulation models as pickle files.

clear_env(simulator, minimal)

Function to clear all simpy Environment in the simulator.

Tools used for Publication Purposes

init()

Plot environment initialisation.

plot_delay(simulator[, delay, span, …])

Plot delay statistics of a ParallelSimulator.

plot_throughput(simulator[, span, semilog])

Plot mean throughput statistics of a ParallelSimulator.

plot_buffer(simulator[, metrics, semilog])

Plot buffer size statistics of a ParallelSimulator.

plot_delay_heatmap(simulator, data_rate[, …])

Plot mean delay statistics of a specified data rate in a ParallelSimulator.

plot_packet_heatmap(simulator, data_rate[, span])

Plot mean packet number statistics of a specified data rate in a ParallelSimulator.

plot_ook_ber([snr_min, snr_max, show_coherent])

Plot OOK bit error rate vs average energy-to-noise ratio [1]_.

plot_scaled_network_delay([data_type])

Plot delay of a scaled network.

Simulation Processes

The NetworkSim.simulation.process module contains essential processes used for the simulation.

RAM Process

RAM(env, until, ram_id, bidirectional[, …])

RAM process generation for simulation.

Transmitter Process

BaseTransmitter(env, ram, transmitter_id, …)

Transmitter processes creator for the simulation.

FT(env, ram, transmitter_id, simulator, until)

Fixed transmitter simulator.

TT(env, ram, transmitter_id, simulator, until)

Tunable transmitter simulator.

TT_U(env, ram, transmitter_id, simulator, until)

Tunable transmitter simulator in bi-directional system, transmitting downstream packets.

TT_D(env, ram, transmitter_id, simulator, until)

Tunable transmitter simulator in bi-directional system, transmitting downstream packets.

Receiver Process

BaseReceiver(env, until, receiver_id, simulator)

Receiver processes creator for the simulation.

FR(env, until, receiver_id, simulator[, model])

Fixed receiver simulator.

TR(env, until, receiver_id, simulator[, model])

Tunable receiver simulator.

FR_U(env, until, receiver_id, simulator[, model])

Fixed receiver simulator corresponding to upstream transmitters.

FR_D(env, until, receiver_id, simulator[, model])

Fixed receiver simulator corresponding to downstream transmitters.

Simulation Setup

The NetworkSim.simulation.simulator module contains a wrapper to set up all necessary processes for the simulation.

Basic Simulation Wrapper

BaseSimulator([until, convergence, sem_tr, …])

Simulation wrapper to create a discrete event simulation of the ring network.

Parallel Simulation

ParallelSimulator([until, convergence, …])

Parallel simulator class to enable multiple simulations to be run in parallel with minimum input parameters.

SystemVerilog Integration

The NetworkSim.system_verilog module contains useful functions to generate relevant files used for writing and verification of the SystemVerilog modules in the project.

Receiver Module

generate_testvector(simulator[, …])

Generate testvector files for receiver module.

Transmitter Module

print_delay_lut([simulator, upstream])

Print delay LUT

generate_testvector(simulator[, …])

Testvector generation for transmitters.