pydistsim.network.rangenetwork.RangeType

class RangeType(environment: Environment)[source]

Bases: ABC

RangeType abstract base class.

This class represents an abstract base class for different types of channels. Subclasses of RangeType should implement the in_comm_range method.

Parameters:

environment (Environment) – The environment in which the channel operates.

Methods

__init__

in_comm_range

Check if two nodes are within communication range.

abstract in_comm_range(network: RangeNetworkType, node1: Node, node2: Node)[source]

Check if two nodes are within communication range.

This method should be implemented by subclasses to determine if two nodes are within communication range.

Parameters:
  • network (RangeNetworkType) – The network in which the nodes are connected.

  • node1 (Node) – The first node.

  • node2 (Node) – The second node.

Returns:

True if the nodes are within communication range, False otherwise.

Return type:

bool