Source code for miniworld.model.network.backends.NetworkBackendNotifications


# TODO: #54: DOC
# TODO: provide context managers!


[docs]class NetworkBackendNotifications: """ This interface describes the interaction between the :py:class:`.SimulationManager`, the :py:class:`.NetworkManager` and the :py:class:`.NetworkBackend`. """ ######################################### # Per step #########################################
[docs] def before_simulation_step(self, simulation_manager, step_cnt, network_backend, emulation_nodes, **kwargs): """ Called before the next simulation step is about to be performed. Called every step. Parameters ---------- simulation_manager : SimulationManager step_cnt : int network_backend : NetworkBackend emulation_nodes : EmulationNodes """ pass
[docs] def after_simulation_step(self, simulation_manager, step_cnt, network_backend, emulation_nodes, **kwargs): """ Called after a simulation step is over. Called every step. Parameters ---------- simulation_manager emulation_nodes network_backend step_cnt """ pass
[docs] def before_distance_matrix_changed(self, simulation_manager, network_backend, changed_distance_matrix, full_distance_matrix, **kwargs): """ Called only if the distance matrix changed. Parameters ---------- changed_distance_matrix simulation_manager network_backend full_distance_matrix kwargs Returns ------- """ pass
[docs] def after_distance_matrix_changed(self, simulation_manager, network_backend, changed_distance_matrix, full_distance_matrix, **kwargs): """ Called only if the distance matrix changed. Parameters ---------- changed_distance_matrix simulation_manager network_backend full_distance_matrix kwargs Returns ------- """ pass
######################################### # Per node ######################################### # TODO: REMOVE? ######################################### # Distributed Mode ######################################### # TODO: PASS CONNECTION OBJECTS? # TODO: return type? Tunnel?
[docs] def connection_across_servers(self, network_backend, emulation_node_x, emulation_node_y, remote_ip): """ Parameters ---------- network_backend emulation_node_x emulation_node_y remote_ip Returns ------- """ pass
[docs]class ConnectionInfo: """ Attributes ---------- is_remote_conn : bool, optional (default is False) is_central : bool, optional (default is False) is_mgmt : bool, optional (default is False) """ def __init__(self, is_remote_conn=False, is_central=False, is_mgmt=False): self.is_remote_conn = is_remote_conn self.is_central = is_central self.is_mgmt = is_mgmt