swarmrl.observables.multi_sensing Module API Reference¶
Class for an observable which computes several observables.
MultiSensing
¶
Bases: Observable
, ABC
Takes several observables and returns them as a list of observables.
Source code in swarmrl/observables/multi_sensing.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
|
__init__(observables)
¶
Constructor for the observable.
In this observables, the order with which the observables are passed to the constructor is the order in which they are concatenated.
Parameters¶
Observables : List[Observable] List of observables.
Source code in swarmrl/observables/multi_sensing.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
|
compute_observable(colloids)
¶
Computes all observables and returns them in a concatenated list.
Parameters¶
colloids : list of all colloids.
Returns¶
List of observables, computed in the order that they were given at initialization.
Notes¶
This may not work well for observables that return different shapes as they must be lists. We should consider a different return type such as a dict. This however needs to be tested on neural networks so the slower lists will work for now.
Source code in swarmrl/observables/multi_sensing.py
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 |
|
initialize(colloids)
¶
Initialize the observables as needed.
Parameters¶
colloids : List[Colloid] List of colloids with which to initialize the observable.
Returns¶
Some of the observables passed to the constructor might need to be initialized with the positions of the colloids. This method does that.
Source code in swarmrl/observables/multi_sensing.py
37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
|