WattsonNetworkLink#
- class wattson.cosimulation.simulators.network.components.wattson_network_link.WattsonNetworkLink(*, id: str, system_name: Optional[str] = None, display_name: Optional[str] = None, network_emulator: Optional[ForwardRef('NetworkEmulator')] = None, emulation_instance: Optional[Any] = None, segment: str = 'main', config: dict = <factory>, _is_started: bool = False, logger: Optional[logging.Logger] = None, interface_a: Optional[ForwardRef('WattsonNetworkInterface')] = None, interface_b: Optional[ForwardRef('WattsonNetworkInterface')] = None, link_model: wattson.cosimulation.simulators.network.components.network_link_model.NetworkLinkModel = <factory>, link_type: str = 'digital')#
Bases:
WattsonNetworkEntity
,NetworkLink
Methods
Sets a callback to be called whenever a link model property is updated.
Set the link state to "down", i.e., disabling the link
get_interface_a
get_interface_b
get_link_model
get_link_state
Given a valid interface, returns the other interface connected forming this link.
get_prefix
is_up
prefix_id
Creates a dictionary for synchronization with a RemoteNetworkEntity.
Set the link state to "up", i.e., enabling the link
Attributes
class_id
entity_id
interface_a
interface_b
link_id
link_type
link_model
config
id
- __init__(*, id: str, system_name: str | None = None, display_name: str | None = None, network_emulator: NetworkEmulator | None = None, emulation_instance: ~typing.Any | None = None, segment: str = 'main', config: dict = <factory>, _is_started: bool = False, logger: ~logging.Logger | None = None, interface_a: WattsonNetworkInterface | None = None, interface_b: WattsonNetworkInterface | None = None, link_model: ~wattson.cosimulation.simulators.network.components.network_link_model.NetworkLinkModel = <factory>, link_type: str = 'digital') None #
- add_on_link_property_change_callback(callback: Callable[[WattsonNetworkLink, str, Any], None])#
Sets a callback to be called whenever a link model property is updated.
- Parameters:
callback (Callable[['WattsonNetworkLink', str, Any], None]) – The callback to call. Takes the link instance, the changed property name and the new value
- down()#
Set the link state to “down”, i.e., disabling the link
- get_other_interface(interface: WattsonNetworkInterface) WattsonNetworkInterface #
Given a valid interface, returns the other interface connected forming this link. In case the given interface is not part of this link, interface A is returned.
- Parameters:
interface ('NetworkInterface') – One interface that forms the link
- Returns:
The other interface forming the link.
- Return type:
‘NetworkInterface’
- to_remote_representation(force_state_synchronization: bool = True) RemoteNetworkEntityRepresentation #
Creates a dictionary for synchronization with a RemoteNetworkEntity.
- Parameters:
force_state_synchronization (bool, optional) – Whether to force a synchronization of the internal state with the actual state (Default value = True)
- Returns:
A dictionary representation of this WattsonNetworkEntity for synchronization with a RemoteNetworkEntity.
- Return type:
- up()#
Set the link state to “up”, i.e., enabling the link