GAMS  1.4.0
ElectionPlurality.h
Go to the documentation of this file.
1 
54 #ifndef _GAMS_ELECTIONS_PLURALITY_ELECTION_H_
55 #define _GAMS_ELECTIONS_PLURALITY_ELECTION_H_
56 
57 #include <vector>
58 #include <string>
59 #include <map>
60 
61 #include "madara/knowledge/containers/StringVector.h"
62 
63 #include "ElectionBase.h"
64 #include "ElectionFactory.h"
65 
66 namespace gams
67 {
68  namespace elections
69  {
74  {
75  public:
82  ElectionPlurality(const std::string & election_prefix = "",
83  const std::string & agent_prefix = "",
84  madara::knowledge::KnowledgeBase * knowledge = 0);
85 
89  virtual ~ElectionPlurality();
90 
97  virtual CandidateList get_leaders(int num_leaders = 1);
98 
102  std::string get_leader(void);
103  };
104 
109  {
110  public:
111 
116 
121 
129  virtual ElectionBase * create(const std::string & election_prefix = "",
130  const std::string & agent_prefix = "",
131  madara::knowledge::KnowledgeBase * knowledge = 0);
132  };
133  }
134 }
135 
136 #endif // _GAMS_ELECTIONS_PLURALITY_ELECTION_H_
Copyright(c) 2016 Carnegie Mellon University.
Copyright(c) 2016 Carnegie Mellon University.
#define GAMS_EXPORT
Definition: GamsExport.h:20
Base class for an election.
Definition: ElectionBase.h:83
Base class for an auction factory.
Factory for creating plurality elections.
virtual ~ElectionPluralityFactory()
Destructor.
virtual ElectionBase * create(const std::string &election_prefix="", const std::string &agent_prefix="", madara::knowledge::KnowledgeBase *knowledge=0)
Creates a plurality election.
An election that implements plurality voting(NOT IMPLEMENTED)
virtual CandidateList get_leaders(int num_leaders=1)
Returns the leaders of the election in order of popularity or whatever conditions constitute winning ...
ElectionPlurality(const std::string &election_prefix="", const std::string &agent_prefix="", madara::knowledge::KnowledgeBase *knowledge=0)
Constructor.
virtual ~ElectionPlurality()
Constructor.
std::string get_leader(void)
Returns the leader of the voting.
std::vector< std::string > CandidateList
list of candidates
Definition: ElectionBase.h:73
Contains all GAMS-related tools, classes and code.