GAMS  1.4.0
ElectionCumulative.h
Go to the documentation of this file.
1 
54 #ifndef _GAMS_ELECTIONS_CUMULATIVE_ELECTION_H_
55 #define _GAMS_ELECTIONS_CUMULATIVE_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  {
75  {
76  public:
83  ElectionCumulative(const std::string & election_prefix = "",
84  const std::string & agent_prefix = "",
85  madara::knowledge::KnowledgeBase * knowledge = 0);
86 
91 
98  virtual CandidateList get_leaders(int num_leaders = 1);
99 
103  std::string get_leader(void);
104  };
105 
110  {
111  public:
112 
117 
122 
130  virtual ElectionBase * create(const std::string & election_prefix = "",
131  const std::string & agent_prefix = "",
132  madara::knowledge::KnowledgeBase * knowledge = 0);
133  };
134  }
135 }
136 
137 #endif // _GAMS_ELECTIONS_CUMULATIVE_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
Factory for creating plurality elections.
virtual ElectionBase * create(const std::string &election_prefix="", const std::string &agent_prefix="", madara::knowledge::KnowledgeBase *knowledge=0)
Creates a plurality election.
virtual ~ElectionCumulativeFactory()
Destructor.
An election that implements cumulative voting.
std::string get_leader(void)
Returns the leader of the voting.
virtual CandidateList get_leaders(int num_leaders=1)
Returns the leaders of the election in order of popularity or whatever conditions constitute winning ...
virtual ~ElectionCumulative()
Constructor.
ElectionCumulative(const std::string &election_prefix="", const std::string &agent_prefix="", madara::knowledge::KnowledgeBase *knowledge=0)
Constructor.
Base class for an auction factory.
std::vector< std::string > CandidateList
list of candidates
Definition: ElectionBase.h:73
Contains all GAMS-related tools, classes and code.