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

Weight and Lambda update heuristic. More...

#include <WeightUpdater.h>

Public Member Functions

 WeightUpdater (AlternativesPerformance &ap, Config &conf)
 
 WeightUpdater (const WeightUpdater &wu)
 
void updateWeightsAndLambda (MRSortModel &model)
 
std::vector< std::vector< std::vector< bool > > > computeXMatrix (MRSortModel &model)
 
std::vector< std::vector< std::vector< bool > > > computeYMatrix (MRSortModel &model)
 
bool modelCheck (MRSortModel &model)
 

Detailed Description

Weight and Lambda update heuristic.

This class implements the update of Criterion weight and the majority threshold lambda as described in the thesis. This algorithm is initialized with the dataset and can then be used to transform a model into an updated one.

The solving of the linear problem is done externally by the LinearSolver. The WeightUpdater class is responsible for computing the constraint matrix given a specific model and passing them to the linear solver.

A complete description of the heuristic can be found in Lambda and Weight updater.

Constructor & Destructor Documentation

◆ WeightUpdater() [1/2]

WeightUpdater::WeightUpdater ( AlternativesPerformance ap,
Config conf 
)

WeightUpdater standard constructor.

Parameters
apAlternativesPerformance objet that represents the dataset of the problem
configconfig setup of the app

◆ WeightUpdater() [2/2]

WeightUpdater::WeightUpdater ( const WeightUpdater wu)

WeightUpdater constructor by copy.

Parameters
wuWeightUpdater objet to copy.

Member Function Documentation

◆ computeXMatrix()

std::vector<std::vector<std::vector<bool> > > WeightUpdater::computeXMatrix ( MRSortModel model)

computexMatrixX Computes linear constraint matrix for x variables. X Constraint matrix are of dimension (n_prof - 1, n_alt, n_crit). In the first dimension, we have the n_prof - 1 profiles of the problem. Inside profile h, we have a row for all alternatives, empty if not classified in profile h. The representation of an alternative a classified in profile h represents the presence or absence of each criterion in the constraint (satisfied as a_i >= b_h-1_i for i criterion).

Parameters
modelMRSortModel use to compute the x matrix
Returns
x_matrix matrix recapitulating the constraints to add to the linear problem for the x variables

◆ computeYMatrix()

std::vector<std::vector<std::vector<bool> > > WeightUpdater::computeYMatrix ( MRSortModel model)

computexMatrixY Computes linear constraint matrix for y variables. Y Constraint matrix are of dimension (n_prof - 1, n_alt, n_crit). In the first dimension, we have the n_prof - 1 profiles of the problem. Inside profile h, we have a row for all alternatives, empty if not classified in profile h. The representation of an alternative a classified in profile h represents the presence or absence of each criterion in the constraint (satisfied as a_i >= b_h_i for i criterion).

Parameters
modelMRSortModel use to compute the y matrix
Returns
y_matrix matrix recapitulating the constraints to add to the linear problem for the y variables

◆ modelCheck()

bool WeightUpdater::modelCheck ( MRSortModel model)

modelCheck Checks if the profile is suited to be updated with this weight updater: it checks if the criterion in the profile appears in the same order as in the dataset.

Parameters
modelMRSortModel to check
Returns
is_suited

◆ updateWeightsAndLambda()

void WeightUpdater::updateWeightsAndLambda ( MRSortModel model)

updateWeightsAndLambda implements the metaheuristic that updates the weights and the majority threshold given the state of the profiles in the model.

Parameters
modelMRSortModel to update

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