GAMS
1.2.2
|
The controller's algorithm factory. More...
#include <AlgorithmFactoryRepository.h>
Public Member Functions | |
AlgorithmFactoryRepository (madara::knowledge::KnowledgeBase *knowledge=0, variables::Sensors *sensors=0, platforms::BasePlatform *platform=0, variables::Self *self=0, variables::Agents *agents=0) | |
Constructor. More... | |
~AlgorithmFactoryRepository () | |
Destructor. More... | |
void | add (const std::vector< std::string > &aliases, AlgorithmFactory *factory) |
Adds an algorithm factory. More... | |
BaseAlgorithm * | create (const std::string &type, const madara::knowledge::KnowledgeMap &args=madara::knowledge::KnowledgeMap()) |
Creates an algorithm. More... | |
void | initialize_default_mappings (void) |
Initializes factories for all supported GAMS algorithms. More... | |
void | set_agents (variables::Agents *agents) |
Sets list of agents participating in swarm. More... | |
void | set_knowledge (madara::knowledge::KnowledgeBase *knowledge) |
Sets the knowledge base. More... | |
void | set_platform (platforms::BasePlatform *platform) |
Sets the map of platform names to platform information. More... | |
void | set_self (variables::Self *self) |
Sets self-referencing variables. More... | |
void | set_sensors (variables::Sensors *sensors) |
Sets the map of sensor names to sensor information. More... | |
Protected Attributes | |
variables::Agents * | agents_ |
list of agents participating in the swarm More... | |
AlgorithmFactoryMap | factory_map_ |
a map of all aliases to factories More... | |
bool | init_finished_ |
flag for seeing if an init defaultshas stopped More... | |
bool | init_started_ |
flag for seeing if an init defaults has started More... | |
madara::knowledge::KnowledgeBase * | knowledge_ |
knowledge base containing variables More... | |
platforms::BasePlatform * | platform_ |
platform variables More... | |
variables::Self * | self_ |
self-referencing variables More... | |
variables::Sensors * | sensors_ |
sensor variables More... | |
The controller's algorithm factory.
Definition at line 79 of file AlgorithmFactoryRepository.h.
gams::algorithms::AlgorithmFactoryRepository::AlgorithmFactoryRepository | ( | madara::knowledge::KnowledgeBase * | knowledge = 0 , |
variables::Sensors * | sensors = 0 , |
||
platforms::BasePlatform * | platform = 0 , |
||
variables::Self * | self = 0 , |
||
variables::Agents * | agents = 0 |
||
) |
Constructor.
knowledge | the knowledge base |
sensors | variables for all sensors |
platform | the current platform |
self | self-referencing variables |
agents | agents of the swarm |
gams::algorithms::AlgorithmFactoryRepository::~AlgorithmFactoryRepository | ( | ) |
Destructor.
void gams::algorithms::AlgorithmFactoryRepository::add | ( | const std::vector< std::string > & | aliases, |
AlgorithmFactory * | factory | ||
) |
Adds an algorithm factory.
aliases | the named aliases for the factory. All aliases will be converted to lower case |
factory | the factory for creating an algorithm |
BaseAlgorithm* gams::algorithms::AlgorithmFactoryRepository::create | ( | const std::string & | type, |
const madara::knowledge::KnowledgeMap & | args = madara::knowledge::KnowledgeMap() |
||
) |
Creates an algorithm.
type | type of algorithm to create |
args | a vector of Knowledge Record arguments |
void gams::algorithms::AlgorithmFactoryRepository::initialize_default_mappings | ( | void | ) |
Initializes factories for all supported GAMS algorithms.
void gams::algorithms::AlgorithmFactoryRepository::set_agents | ( | variables::Agents * | agents | ) |
Sets list of agents participating in swarm.
agents | agents in the swarm |
void gams::algorithms::AlgorithmFactoryRepository::set_knowledge | ( | madara::knowledge::KnowledgeBase * | knowledge | ) |
Sets the knowledge base.
knowledge | the knowledge base to use |
void gams::algorithms::AlgorithmFactoryRepository::set_platform | ( | platforms::BasePlatform * | platform | ) |
Sets the map of platform names to platform information.
platform | the platform to use |
void gams::algorithms::AlgorithmFactoryRepository::set_self | ( | variables::Self * | self | ) |
Sets self-referencing variables.
self | self-referencing variables |
void gams::algorithms::AlgorithmFactoryRepository::set_sensors | ( | variables::Sensors * | sensors | ) |
Sets the map of sensor names to sensor information.
sensors | map of sensor names to sensor information |
|
protected |
list of agents participating in the swarm
Definition at line 159 of file AlgorithmFactoryRepository.h.
|
protected |
a map of all aliases to factories
Definition at line 174 of file AlgorithmFactoryRepository.h.
|
protected |
flag for seeing if an init defaultshas stopped
Definition at line 180 of file AlgorithmFactoryRepository.h.
|
protected |
flag for seeing if an init defaults has started
Definition at line 177 of file AlgorithmFactoryRepository.h.
|
protected |
knowledge base containing variables
Definition at line 162 of file AlgorithmFactoryRepository.h.
|
protected |
platform variables
Definition at line 165 of file AlgorithmFactoryRepository.h.
|
protected |
self-referencing variables
Definition at line 168 of file AlgorithmFactoryRepository.h.
|
protected |
sensor variables
Definition at line 171 of file AlgorithmFactoryRepository.h.