Project
ProfileUpdater.h
Go to the documentation of this file.
1 #ifndef PROFILEUPDATER_H
2 #define PROFILEUPDATER_H
3 
10 #include <iostream>
11 #include <string>
12 #include <vector>
13 
14 #include "../app.h"
15 #include "../types/MRSortModel.h"
16 
30 public:
39  float epsilon = 0.00001);
40 
47 
48  ~ProfileUpdater();
49 
66  std::unordered_map<float, float>
67  computeAboveDesirability(MRSortModel &model, std::string critId, Perf &b,
68  Perf &b_above, Category &cat, Category &cat_above,
69  std::unordered_map<std::string, float> &ct_prof,
70  AlternativesPerformance &altPerf_model);
71 
88  std::unordered_map<float, float>
89  computeBelowDesirability(MRSortModel &model, std::string critId, Perf &b,
90  Perf &b_below, Category &cat, Category &cat_above,
91  std::unordered_map<std::string, float> &ct_prof,
92  AlternativesPerformance &altPerf_model);
93 
103  std::pair<float, float>
104  chooseMaxDesirability(std::unordered_map<float, float> &desirability,
105  Perf &b);
106 
122  MRSortModel &model, std::string critId, Perf &b_old, Perf &b_new,
123  std::unordered_map<std::string, std::unordered_map<std::string, float>>
124  &ct,
125  AlternativesPerformance &altPerf_model);
126 
139  std::vector<Perf> &prof, Category &cat_below, Category &cat_above,
140  MRSortModel &model,
141  std::unordered_map<std::string, std::unordered_map<std::string, float>>
142  &ct,
143  AlternativesPerformance &altPerf_model);
144 
153  void optimize(MRSortModel &model,
154  std::unordered_map<std::string,
155  std::unordered_map<std::string, float>> &ct,
156  AlternativesPerformance &altPerf_model);
157 
165 
166 private:
167  float epsilon_;
168  AlternativesPerformance &altPerf_data;
169  Config &conf;
170 };
171 
172 #endif
Dataset datastructure.
Definition: AlternativesPerformance.h:35
Category datastructure.
Definition: Category.h:20
Datastructure of the model to learn.
Definition: MRSortModel.h:37
Perf (single performance) data structure.
Definition: Perf.h:22
Third step of the heuristic, updates the profiles given fixed weight and lambda.
Definition: ProfileUpdater.h:29
void updateProfiles(MRSortModel &model)
std::unordered_map< float, float > computeBelowDesirability(MRSortModel &model, std::string critId, Perf &b, Perf &b_below, Category &cat, Category &cat_above, std::unordered_map< std::string, float > &ct_prof, AlternativesPerformance &altPerf_model)
std::pair< float, float > chooseMaxDesirability(std::unordered_map< float, float > &desirability, Perf &b)
void optimizeProfile(std::vector< Perf > &prof, Category &cat_below, Category &cat_above, MRSortModel &model, std::unordered_map< std::string, std::unordered_map< std::string, float >> &ct, AlternativesPerformance &altPerf_model)
ProfileUpdater(const ProfileUpdater &profUp)
void optimize(MRSortModel &model, std::unordered_map< std::string, std::unordered_map< std::string, float >> &ct, AlternativesPerformance &altPerf_model)
ProfileUpdater(Config &conf, AlternativesPerformance &altPerf_data, float epsilon=0.00001)
void updateTables(MRSortModel &model, std::string critId, Perf &b_old, Perf &b_new, std::unordered_map< std::string, std::unordered_map< std::string, float >> &ct, AlternativesPerformance &altPerf_model)
std::unordered_map< float, float > computeAboveDesirability(MRSortModel &model, std::string critId, Perf &b, Perf &b_above, Category &cat, Category &cat_above, std::unordered_map< std::string, float > &ct_prof, AlternativesPerformance &altPerf_model)
High level configuration of the app.
Definition: config.h:20