pydistsim.network.sensor

Sensors provide a way for node to interact with its environment.

Sensors can also be used to satisfy algorithm prerequisites.

Generally sensors should incorporate some model of measurement insecurity that is inherent in real world sensors. This is implemented as a ProbabilityFunction.

Basic usage:

>>> node.compositeSensor = ('DistSensor','AoASensor')
>>> node.compositeSensor.sensors
(<pydistsim.network.sensor.DistSensor at 0x6d3fbb0>,
 <pydistsim.network.sensor.AoASensor at 0x6d3f950>)

To manually set sensor parameters first make an sensor instance:

>>> import scipy.stats
>>> aoa_sensor = AoASensor({'pf': scipy.stats.norm, 'scale': 10*pi/180 })
>>> node.compositeSensor = (aoa_sensor,)

Functions

node_in_network

Decorator function that checks if node is in network.

Classes

AoASensor

Provides azimuth between node and its neighbors.

CompositeSensor

Wrap multiple sensors, coalesce results and return composite readout.

DistSensor

Provides distance between node and its neighbors.

ProbabilityFunction

Provides a way to get noisy reading.

Sensor

Abstract base class for all Sensors.

TruePosSensor

Provides node's true position.

Exceptions

SensorError