54 #ifndef _GAMS_ELECTIONS_ELECTION_FACTORY_REPOSITORY_H_
55 #define _GAMS_ELECTIONS_ELECTION_FACTORY_REPOSITORY_H_
61 #include "madara/knowledge/KnowledgeBase.h"
85 const std::string & agent_prefix,
86 madara::knowledge::KnowledgeBase * knowledge = 0);
150 #include "ElectionFactoryRepository.inl"
Copyright(c) 2016 Carnegie Mellon University.
Base class for an election.
A repository for election factories.
ElectionFactoryRepository(const std::string &agent_prefix, madara::knowledge::KnowledgeBase *knowledge=0)
Constructor.
madara::knowledge::KnowledgeBase * knowledge_
knowledge base containing variables
void init(void)
Initializes factories for all supported GAMS elections.
virtual ~ElectionFactoryRepository()
Destructor.
ElectionBase * create(ElectionType type)
Creates an election based on type.
void set_knowledge(madara::knowledge::KnowledgeBase *knowledge)
Sets the knowledge base.
std::string agent_prefix_
self prefix of the agent
void add(ElectionType type, ElectionFactory *factory)
Adds an algorithm factory.
ElectionFactoryMap factory_map_
a mapping of types to election factories
ElectionBase * create(const std::string &election_prefix)
Creates an election based on type.
void set_agent_prefix(const std::string &prefix)
Sets the prefix for the current voting agent.
Base class for an auction factory.
std::map< ElectionType, ElectionFactory * > ElectionFactoryMap
Convenience typedef for a map of types to factories.
madara::knowledge::KnowledgeRecord::Integer ElectionType
convenience typedef for ElectionType
Contains all GAMS-related tools, classes and code.