swarmrl.tasks.multi_tasking Module API Reference¶
Class for multi-tasking.
MultiTasking
¶
Bases: Task
Class for handling multiple tasks.
Source code in swarmrl/tasks/multi_tasking.py
13 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 |
|
__call__(colloids)
¶
Computes all observables and returns them in a concatenated list.
Parameters¶
colloids : list of all colloids.
Returns¶
rewards : np.ndarray of shape (num_colloids, ) Array of rewards for each colloid.
Source code in swarmrl/tasks/multi_tasking.py
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 |
|
__init__(particle_type=0, tasks=[])
¶
Constructor for multi-tasking.
Source code in swarmrl/tasks/multi_tasking.py
18 19 20 21 22 23 |
|
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/tasks/multi_tasking.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
|