Skip to content

Node

gradysim.simulator.node

This is a simple module containing declarations necessary to keep track of the nodes during the simulation

Node

Bases: Generic[T]

Represents a node inside the python simulation. Holds the reference to the node's encapsulated protocol. This class is accessible to handlers.

Source code in gradysim/simulator/node.py
class Node(Generic[T]):
    """
    Represents a node inside the python simulation. Holds the reference to the node's encapsulated protocol.
    This class is accessible to [handlers][gradysim.simulator.handler].
    """
    id: int
    """Node's unique identifier"""

    protocol_encapsulator: IEncapsulator[T]
    """Node's encapsulated protocol"""

    position: Position
    """Node's position inside the simulation"""

id: int instance-attribute

Node's unique identifier

position: Position instance-attribute

Node's position inside the simulation

protocol_encapsulator: IEncapsulator[T] instance-attribute

Node's encapsulated protocol