Project
Public Member Functions | Public Attributes | Friends | List of all members
MRSortModel Class Reference

Datastructure of the model to learn. More...

#include <MRSortModel.h>

Collaboration diagram for MRSortModel:
Collaboration graph
[legend]

Public Member Functions

 MRSortModel (Criteria &criteria, Profiles &profiles, Categories &categories, float lambda, std::string id="model")
 
 MRSortModel (int n_cat, int n_crit, std::string id="model")
 
 MRSortModel (const MRSortModel &mrsort)
 
std::string getId () const
 
float getScore () const
 
void setScore (float score)
 
Category categoryAssignment (std::vector< Perf > &alt, std::vector< std::vector< Perf >> &profiles_pt)
 
AlternativesPerformance categoryAssignments (PerformanceTable &pt)
 
float computeConcordance (std::vector< Perf > &prof, std::vector< Perf > &alt)
 
std::unordered_map< std::string, std::unordered_map< std::string, float > > computeConcordanceTable (PerformanceTable &pt)
 

Public Attributes

Criteria criteria
 
Profiles profiles
 
float lambda
 
Categories categories
 

Friends

std::ostream & operator<< (std::ostream &out, const MRSortModel &mrsort)
 

Detailed Description

Datastructure of the model to learn.

The MRSortModel is the datastructure that represents a complete modelisation of the problem to learn. The state of a model is defined by lambda, a Criteria object and a Profile object. Lambda is a float representing the global threshold of the problem, the Profile object hold the values that defined the profiles delimiting all the categories, and Criteria holds the weights of each Criterion.

The model is the "atomic" object that we use in the metaheuristic, it is the datastructure running trough the different pipeline and modified by the learning algorithms.

The performance of the model is evaluated by running the ground truth dataset into the model and looking at the category assignment.

Constructor & Destructor Documentation

◆ MRSortModel() [1/3]

MRSortModel::MRSortModel ( Criteria criteria,
Profiles profiles,
Categories categories,
float  lambda,
std::string  id = "model" 
)

MRSortModel standard constructor

Parameters
criteriaCriteria object
profilesProfiles containing the profiles
categoriesCategories object used for the profiles
lambdathreshold
idoptional name of the model

◆ MRSortModel() [2/3]

MRSortModel::MRSortModel ( int  n_cat,
int  n_crit,
std::string  id = "model" 
)

MRSortModel generator constructor. This constructor initializes the profiles, lambda and criteria weights at random.

Parameters
n_catnumber of categories
n_critnumber of criteria
idmrsort model's id

◆ MRSortModel() [3/3]

MRSortModel::MRSortModel ( const MRSortModel mrsort)

MRSortModel constructor by copy

Parameters
mrsortMRSortModel object to copy

Member Function Documentation

◆ categoryAssignment()

Category MRSortModel::categoryAssignment ( std::vector< Perf > &  alt,
std::vector< std::vector< Perf >> &  profiles_pt 
)

categoryAssignment assign the category given the alternative and the current state of the model.

Parameters
altPerfVect of the alternative
profiles_ptPerfTable of the profiles
Returns
category_assignment Category object associated to the alternative

◆ categoryAssignments()

AlternativesPerformance MRSortModel::categoryAssignments ( PerformanceTable pt)

categoryAssignments assign the categories given the performance table and the current state of the model.

Parameters
ptPerformanceTable
Returns
category_assignment AlternativeAssignment object containing the pt given in args and the category assignment.

◆ computeConcordance()

float MRSortModel::computeConcordance ( std::vector< Perf > &  prof,
std::vector< Perf > &  alt 
)

computeConcordance computes the concordance value between a profile and an alternative

Parameters
profprofile
altalternative
Returns
concordance value

◆ computeConcordanceTable()

std::unordered_map<std::string, std::unordered_map<std::string, float> > MRSortModel::computeConcordanceTable ( PerformanceTable pt)

computeConcordanceTable computes the concordance table of a performance table

Parameters
ptPerformanceTable
Returns
concordance table giving the concordance value for each profile, alternative tupple, displayed in a map { prof_id1 : {alt_id1 : c1, alt_id2: c2, ...}, ...}

◆ getId()

std::string MRSortModel::getId ( ) const

getId getter of id parameter

Returns
id

◆ getScore()

float MRSortModel::getScore ( ) const

getScore getter of score parameter

Returns
score

◆ setScore()

void MRSortModel::setScore ( float  score)

setScore setter of score parameter

Parameters
scorenew score

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