pydistsim.network.sensor.CompositeSensor
- class CompositeSensor(node: Node, componentSensors: tuple[type[Sensor] | str] | None = None)[source]
Bases:
objectWrap multiple sensors, coalesce results and return composite readout.
This class is not a sensor itself, i.e. subclass of
Sensor, instead it serves as a placeholder for multiple sensors that can be attached to aNode.- Parameters:
Methods
__init__Get a sensor by its name.
Read measurements from all sensors.
Attributes
Get the sensors associated with the object.
- get_sensor(name: str) Sensor[source]
Get a sensor by its name.
- Parameters:
name (str) – The name of the sensor.
- Returns:
The sensor object.
- Return type:
- Raises:
SensorError – If multiple or no sensors are found with the given name.