swarmrl.observables.position Module API Reference¶
Position observable computer.
PositionObservable
¶
Bases: Observable
, ABC
Position in box observable.
Source code in swarmrl/observables/position.py
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 |
|
__init__(box_length, particle_type=0)
¶
Constructor for the observable.
Parameters¶
box_length : np.ndarray Length of the box with which to normalize.
Source code in swarmrl/observables/position.py
20 21 22 23 24 25 26 27 28 29 30 |
|
compute_observable(colloids)
¶
Compute the current state observable for all colloids.
Parameters¶
colloids : List[Colloid] (n_colloids, ) List of all colloids in the system.
Source code in swarmrl/observables/position.py
49 50 51 52 53 54 55 56 57 58 59 60 |
|
compute_single_observable(index, colloids)
¶
Compute the position of the colloid.
Parameters¶
index : int Index of the colloid for which the observable should be computed. colloids : list Colloids in the system.
Source code in swarmrl/observables/position.py
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
|