Project
Criteria.h
Go to the documentation of this file.
1 #ifndef CRITERIA_H
2 #define CRITERIA_H
3 
10 #include "Criterion.h"
11 #include <iostream>
12 #include <vector>
13 
25 class Criteria {
26 public:
32  Criteria(std::vector<Criterion> &criterion_vect);
33 
40  Criteria(int nb_of_criterion, std::string prefix = "crit");
41 
47  Criteria(const Criteria &crits);
48 
49  ~Criteria();
50 
51  friend std::ostream &operator<<(std::ostream &out, const Criteria &crits);
52 
53  // TODO Remove getter and setter
54  // Performance wise after some profiling we found that getter and setter can
55  // loose a lot of time compared to access directly the variable. Therefore in
56  // order to optimize the code, they should be removed.
62  void setCriterionVect(std::vector<Criterion> &criterion_vect_);
63 
69  std::vector<Criterion> getCriterionVect() const;
70 
71  // TODO looks like this could be removed as it is never used
77  float getMinWeight();
78 
79  // TODO looks like this could be removed as it is never used
85  float getMaxWeight();
86 
87  // TODO looks like this could be removed as it is never used
93  float getSumWeight();
94 
100  std::vector<float> getWeights() const;
101 
106  void setWeights(std::vector<float> newWeights);
107 
108  // TODO looks like this could be removed as it is never used
115 
120  void generateRandomCriteriaWeights(unsigned long int seed = time(NULL));
121 
129  Criterion operator[](std::string name) const;
130 
138  Criterion operator[](int index);
139  Criterion operator[](int index) const;
140 
141 private:
142  std::vector<Criterion> criterion_vect_;
143 };
144 
145 #endif
Datastructure representing a criterion.
Set of Criterion datastructure.
Definition: Criteria.h:25
void generateRandomCriteriaWeights(unsigned long int seed=time(NULL))
std::vector< float > getWeights() const
float getSumWeight()
float getMaxWeight()
Criteria(int nb_of_criterion, std::string prefix="crit")
void normalizeWeights()
Criteria(std::vector< Criterion > &criterion_vect)
void setWeights(std::vector< float > newWeights)
Criterion operator[](int index)
float getMinWeight()
Criteria(const Criteria &crits)
void setCriterionVect(std::vector< Criterion > &criterion_vect_)
Criterion operator[](std::string name) const
std::vector< Criterion > getCriterionVect() const
Criterion datastructure.
Definition: Criterion.h:21