Project
Public Member Functions | List of all members
ProfileUpdater Class Reference

Third step of the heuristic, updates the profiles given fixed weight and lambda. More...

#include <ProfileUpdater.h>

Public Member Functions

 ProfileUpdater (Config &conf, AlternativesPerformance &altPerf_data, float epsilon=0.00001)
 
 ProfileUpdater (const ProfileUpdater &profUp)
 
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)
 
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 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)
 
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)
 
void optimize (MRSortModel &model, std::unordered_map< std::string, std::unordered_map< std::string, float >> &ct, AlternativesPerformance &altPerf_model)
 
void updateProfiles (MRSortModel &model)
 

Detailed Description

Third step of the heuristic, updates the profiles given fixed weight and lambda.

Profile Updater algorithm is responsible for updating the profiles given the fixed weight and lambda. It will evaluate each move of each profile on each criterion to see what moves have the best impact on the alternatives assignments.

Constructor & Destructor Documentation

◆ ProfileUpdater() [1/2]

ProfileUpdater::ProfileUpdater ( Config conf,
AlternativesPerformance altPerf_data,
float  epsilon = 0.00001 
)

ProfileUpdater standard constructor

Parameters
confconf setup for logging
altPerf_dataalternative perfomances dataset
epsilon

◆ ProfileUpdater() [2/2]

ProfileUpdater::ProfileUpdater ( const ProfileUpdater profUp)

ProfileUpdater copy constructor

Parameters
profUpProfileUpdater to copy

Member Function Documentation

◆ chooseMaxDesirability()

std::pair<float, float> ProfileUpdater::chooseMaxDesirability ( std::unordered_map< float, float > &  desirability,
Perf b 
)

chooseMaxDesirability chooses the move of the profiles that maximizes the desirability

Parameters
desirabilitymap of desirability
bprofile to move
Returns
profile value and associate desirability (max)

◆ computeAboveDesirability()

std::unordered_map<float, float> ProfileUpdater::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 
)

computeAboveDesirability computes the desirability of a move for the profile b (move up)

Parameters
modelcurrent model
critIdcrit on which we want to evaluate the move
bprofile we want to move
b_aboveprofile above
catcategory delimited by the profile (below)
cat_aboveabove category delimited by the profile
ct_profconcordance table of the profile
altPerf_modelalternativePerformance calculated with current model
Returns
the map of potential new perf for the profile and their desirability

◆ computeBelowDesirability()

std::unordered_map<float, float> ProfileUpdater::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 
)

computeBelowDesirability computes the desirability of a move for the profile b (move down)

Parameters
modelcurrent model
critIdcrit on which we want to evaluate the move
bprofile we want to move
b_belowprofile below
catcategory delimited by the profile (below)
cat_aboveabove category delimited by the profile
ct_profconcordance table of the profile
altPerf_modelalternativePerformance calculated with current model
Returns
the map of potential new perf for the profile and their desirability

◆ optimize()

void ProfileUpdater::optimize ( MRSortModel model,
std::unordered_map< std::string, std::unordered_map< std::string, float >> &  ct,
AlternativesPerformance altPerf_model 
)

optimize Optimizes all the profiles using the profileUpdater methods.

Parameters
modelcurrent model
ctconcordance table
altPerf_modelaltPerf_model

◆ optimizeProfile()

void ProfileUpdater::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 
)

optimizeProfile Optimizes one profile using the profileUpdater methods.

Parameters
profprofile to optimize
cat_belowcategory delimited by the profile (below)
cat_abovecategory delimited by the profile (above)
modelcurrent model
ctconcordance table
altPerf_modelaltPerf_model

◆ updateProfiles()

void ProfileUpdater::updateProfiles ( MRSortModel model)

updateProfiles Updates the profiles of the model using the metaheuristic

Parameters
modelcurrent model

◆ updateTables()

void ProfileUpdater::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 
)

updateTables updates model tables with new profile value

  • concordance table
  • alternative assignement
  • profiles
Parameters
model
critIdcriterion on which the profile moves
b_oldold profile perf
b_newnew profile perf
ctconcordance table to update
altPerf_modelalternativePerformance calculated with current model

The documentation for this class was generated from the following file: