pydistsim.network.sensor.Sensor

class Sensor[source]

Bases: ABC

Abstract base class for all Sensors.

Sensor provides a certain capability for a node, providing information about the outside world. It could be a capability to detect neighbors, measure distance to them, or retrieve the environment temperature.

Parameters:
  • dict_args (dict) – A dictionary containing the scale and probability function.

  • scale (float) – The scale parameter for the probability function.

  • pf (rv_continuous or rv_discrete) – The probability function (e.g. scipy.stats.norm).

Methods

__init__

name

Get the name of the Sensor class.

read

Read the sensor data.

classmethod name()[source]

Get the name of the Sensor class.

Returns:

The name of the Sensor class.

Return type:

str

abstract read() dict[source]

Read the sensor data.

This method should be overridden in a subclass.

Returns:

The sensor data.

Return type:

dict