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.
| 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 |
| virtual gams::elections::ElectionFactoryRepository::~ElectionFactoryRepository |
( |
| ) |
|
|
virtual |
Adds an algorithm factory.
- Parameters
-
| type | the type for this factory |
| factory | the factory for creating an algorithm |
- Returns
- the new algorithm
| 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
Creates an election based on type.
- Parameters
-
| type | the type of the election ( |
- See also
- ElectionTypes)
- Returns
- the new election
| void gams::elections::ElectionFactoryRepository::init |
( |
void |
| ) |
|
|
protected |
Initializes factories for all supported GAMS elections.
| 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) |
| void gams::elections::ElectionFactoryRepository::set_knowledge |
( |
madara::knowledge::KnowledgeBase * |
knowledge | ) |
|
Sets the knowledge base.
- Parameters
-
| knowledge | the knowledge base to use |
| std::string gams::elections::ElectionFactoryRepository::agent_prefix_ |
|
protected |
| madara::knowledge::KnowledgeBase* gams::elections::ElectionFactoryRepository::knowledge_ |
|
protected |
The documentation for this class was generated from the following file: