GAMS  1.4.0
gams::algorithms::AlgorithmFactoryRepository Class Reference

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...
 
BaseAlgorithmcreate (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::Agentsagents_
 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::BasePlatformplatform_
 platform variables More...
 
variables::Selfself_
 self-referencing variables More...
 
variables::Sensorssensors_
 sensor variables More...
 

Detailed Description

The controller's algorithm factory.

Definition at line 79 of file AlgorithmFactoryRepository.h.

Constructor & Destructor Documentation

◆ AlgorithmFactoryRepository()

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.

Parameters
knowledgethe knowledge base
sensorsvariables for all sensors
platformthe current platform
selfself-referencing variables
agentsagents of the swarm

◆ ~AlgorithmFactoryRepository()

gams::algorithms::AlgorithmFactoryRepository::~AlgorithmFactoryRepository ( )

Destructor.

Member Function Documentation

◆ add()

void gams::algorithms::AlgorithmFactoryRepository::add ( const std::vector< std::string > &  aliases,
AlgorithmFactory factory 
)

Adds an algorithm factory.

Parameters
aliasesthe named aliases for the factory. All aliases will be converted to lower case
factorythe factory for creating an algorithm
Returns
the new algorithm

◆ create()

BaseAlgorithm* gams::algorithms::AlgorithmFactoryRepository::create ( const std::string &  type,
const madara::knowledge::KnowledgeMap &  args = madara::knowledge::KnowledgeMap() 
)

Creates an algorithm.

Parameters
typetype of algorithm to create
argsa vector of Knowledge Record arguments
Returns
the new algorithm

◆ initialize_default_mappings()

void gams::algorithms::AlgorithmFactoryRepository::initialize_default_mappings ( void  )

Initializes factories for all supported GAMS algorithms.

◆ set_agents()

void gams::algorithms::AlgorithmFactoryRepository::set_agents ( variables::Agents agents)

Sets list of agents participating in swarm.

Parameters
agentsagents in the swarm

◆ set_knowledge()

void gams::algorithms::AlgorithmFactoryRepository::set_knowledge ( madara::knowledge::KnowledgeBase *  knowledge)

Sets the knowledge base.

Parameters
knowledgethe knowledge base to use

◆ set_platform()

void gams::algorithms::AlgorithmFactoryRepository::set_platform ( platforms::BasePlatform platform)

Sets the map of platform names to platform information.

Parameters
platformthe platform to use

◆ set_self()

void gams::algorithms::AlgorithmFactoryRepository::set_self ( variables::Self self)

Sets self-referencing variables.

Parameters
selfself-referencing variables

◆ set_sensors()

void gams::algorithms::AlgorithmFactoryRepository::set_sensors ( variables::Sensors sensors)

Sets the map of sensor names to sensor information.

Parameters
sensorsmap of sensor names to sensor information

Member Data Documentation

◆ agents_

variables::Agents* gams::algorithms::AlgorithmFactoryRepository::agents_
protected

list of agents participating in the swarm

Definition at line 159 of file AlgorithmFactoryRepository.h.

◆ factory_map_

AlgorithmFactoryMap gams::algorithms::AlgorithmFactoryRepository::factory_map_
protected

a map of all aliases to factories

Definition at line 174 of file AlgorithmFactoryRepository.h.

◆ init_finished_

bool gams::algorithms::AlgorithmFactoryRepository::init_finished_
protected

flag for seeing if an init defaultshas stopped

Definition at line 180 of file AlgorithmFactoryRepository.h.

◆ init_started_

bool gams::algorithms::AlgorithmFactoryRepository::init_started_
protected

flag for seeing if an init defaults has started

Definition at line 177 of file AlgorithmFactoryRepository.h.

◆ knowledge_

madara::knowledge::KnowledgeBase* gams::algorithms::AlgorithmFactoryRepository::knowledge_
protected

knowledge base containing variables

Definition at line 162 of file AlgorithmFactoryRepository.h.

◆ platform_

platforms::BasePlatform* gams::algorithms::AlgorithmFactoryRepository::platform_
protected

platform variables

Definition at line 165 of file AlgorithmFactoryRepository.h.

◆ self_

variables::Self* gams::algorithms::AlgorithmFactoryRepository::self_
protected

self-referencing variables

Definition at line 168 of file AlgorithmFactoryRepository.h.

◆ sensors_

variables::Sensors* gams::algorithms::AlgorithmFactoryRepository::sensors_
protected

sensor variables

Definition at line 171 of file AlgorithmFactoryRepository.h.


The documentation for this class was generated from the following file: