Struct swarm_iterator
Defined in File swarm_iterator.hpp
Struct Documentation
-
struct swarm_iterator
Iterate over the swarm (robots or controllers), and perform an action within the ARGoS simulator.
The selected action can be specified to be performed in static order (single-threaded execution), or in dynamic order (multi-threaded execution) for speed.
Public Static Functions
-
template<typename TController, iteration_order order, typename TFunction, typename std::enable_if<iteration_order::ekDYNAMIC == order, int>::type = 0>
static inline void controllers(const cpargos::swarm_manager_adaptor *const sm, const TFunction &cb) Iterate through robots using dynamic ordering.
- Template Parameters:
TControllerType – The type of the controller.
TFunction – Type of the lambda callback (inferred).
order – The order of iteration: static or dynamic.
- Parameters:
sm – Handle to the cpargos::swarm_manager_adaptor.
cb – Function to run on each robot in the swarm.
-
template<typename TController, iteration_order order, typename TFunction, typename std::enable_if<iteration_order::ekSTATIC == order, int>::type = 0>
static inline void controllers(const cpargos::swarm_manager_adaptor *const sm, const TFunction &cb, const std::string &robot_type) Iterate through controllers using static ordering.
- Template Parameters:
TControllerType – The type of the controller.
order – The order of iteration: static or dynamic.
TFunction – Type of the lambda callback to use (inferred).
- Parameters:
sm – Handle to the cpargos::swarm_manager_adaptor.
cb – Function to run on each robot in the swarm.
robot_type – Name associated with the robot type within ARGoS.
-
template<iteration_order order, typename TFunction, typename std::enable_if<iteration_order::ekDYNAMIC == order, int>::type = 0>
static inline void robots(const cpargos::swarm_manager_adaptor *const sm, const TFunction &cb) Iterate through robots using dynamic ordering.
- Template Parameters:
TFunction – Type of the lambda callback (inferred).
order – The order of iteration: static or dynamic.
- Parameters:
sm – Handle to the cpargos::swarm_manager_adaptor.
cb – Function to run on each robot in the swarm.
-
template<iteration_order order, typename TFunction, typename std::enable_if<iteration_order::ekSTATIC == order, int>::type = 0>
static inline void robots(const cpargos::swarm_manager_adaptor *const sm, const TFunction &cb, const std::string &robot_type) Iterate through robots using static ordering.
- Template Parameters:
TFunction – Type of the lambda callback (inferred).
order – The order of iteration: static or dynamic.
- Parameters:
sm – Handle to the cpargos::swarm_manager_adaptor.
cb – Function to run on each robot in the swarm.
robot_type – Name associated with the robot type within ARGoS.
-
template<typename TController, iteration_order order, typename TFunction, typename std::enable_if<iteration_order::ekDYNAMIC == order, int>::type = 0>