topolib.elements package

Submodules

topolib.elements.node module

Node class for optical network topologies.

This module defines the Node class, representing a network node with geographic coordinates.

class topolib.elements.node.Node(id: int, name: str, latitude: float, longitude: float, weight: float = 0, pop: int = 0, dc: int = 0, ixp: int = 0)

Bases: object

Represents a node in an optical network topology.

Parameters:
  • id (int) – Unique identifier for the node.

  • name (str) – Name of the node.

  • latitude (float) – Latitude coordinate of the node.

  • longitude (float) – Longitude coordinate of the node.

  • weight (float or int) – Node weight (optional, default 0).

  • pop (int) – Node population (optional, default 0).

  • dc (int) – Datacenter (DC) value for the node (optional, default 0).

  • ixp (int) – IXP (Internet Exchange Point) value for the node (optional, default 0).

coordinates() Tuple[float, float]

Returns the (latitude, longitude) coordinates of the node.

Returns:

Tuple containing latitude and longitude.

Return type:

Tuple[float, float]

property dc: int

Get the datacenter (DC) count or value for the node.

Returns:

Node DC value.

Return type:

int

property id: int

Get the unique identifier of the node.

Returns:

Node ID.

Return type:

int

property ixp: int

Get the IXP (Internet Exchange Point) count or value for the node.

Returns:

Node IXP value.

Return type:

int

property latitude: float

Get the latitude coordinate of the node.

Returns:

Latitude value.

Return type:

float

property longitude: float

Get the longitude coordinate of the node.

Returns:

Longitude value.

Return type:

float

property name: str

Get the name of the node.

Returns:

Node name.

Return type:

str

property pop: int

Get the population of the node.

Returns:

Node population.

Return type:

int

property weight: float

Get the weight of the node.

Returns:

Node weight.

Return type:

float