A repository for election factories.
More...
#include <ElectionFactoryRepository.h>
|
void | init (void) |
| Initializes factories for all supported GAMS elections. More...
|
|
A repository for election factories.
Definition at line 76 of file ElectionFactoryRepository.h.
◆ ElectionFactoryRepository()
gams::elections::ElectionFactoryRepository::ElectionFactoryRepository |
( |
const std::string & |
agent_prefix, |
|
|
madara::knowledge::KnowledgeBase * |
knowledge = 0 |
|
) |
| |
Constructor.
- Parameters
-
agent_prefix | the name of this voter (e.g. agent.0) |
knowledge | a knowledge base where election info is |
◆ ~ElectionFactoryRepository()
virtual gams::elections::ElectionFactoryRepository::~ElectionFactoryRepository |
( |
| ) |
|
|
virtual |
◆ add()
Adds an algorithm factory.
- Parameters
-
type | the type for this factory |
factory | the factory for creating an algorithm |
- Returns
- the new algorithm
◆ create() [1/2]
ElectionBase* gams::elections::ElectionFactoryRepository::create |
( |
const std::string & |
election_prefix | ) |
|
Creates an election based on type.
- Parameters
-
election_prefix | the name of the election (e.g. election.position) |
- Returns
- the new election
◆ create() [2/2]
Creates an election based on type.
- Parameters
-
type | the type of the election ( |
- See also
- ElectionTypes)
- Returns
- the new election
◆ init()
void gams::elections::ElectionFactoryRepository::init |
( |
void |
| ) |
|
|
protected |
Initializes factories for all supported GAMS elections.
◆ set_agent_prefix()
void gams::elections::ElectionFactoryRepository::set_agent_prefix |
( |
const std::string & |
prefix | ) |
|
Sets the prefix for the current voting agent.
- Parameters
-
prefix | the name of the agent (e.g. agent.0) |
◆ set_knowledge()
void gams::elections::ElectionFactoryRepository::set_knowledge |
( |
madara::knowledge::KnowledgeBase * |
knowledge | ) |
|
Sets the knowledge base.
- Parameters
-
knowledge | the knowledge base to use |
◆ agent_prefix_
std::string gams::elections::ElectionFactoryRepository::agent_prefix_ |
|
protected |
◆ factory_map_
◆ knowledge_
madara::knowledge::KnowledgeBase* gams::elections::ElectionFactoryRepository::knowledge_ |
|
protected |
The documentation for this class was generated from the following file: