Dataset datastructure.
More...
#include <AlternativesPerformance.h>
|
| | AlternativesPerformance (std::vector< std::vector< Perf >> &perf_vect, std::unordered_map< std::string, Category > &alt_assignment=default_map) |
| |
| | AlternativesPerformance (int nb_of_perfs, Criteria &crits, std::string prefix="alt", std::unordered_map< std::string, Category > &alt_assignment=default_map) |
| |
| | AlternativesPerformance (const PerformanceTable &perf_table, std::unordered_map< std::string, Category > &alt_assignment=default_map) |
| |
| | AlternativesPerformance (const AlternativesPerformance &alt) |
| |
| std::unordered_map< std::string, Category > | getAlternativesAssignments () const |
| |
| void | setAlternativesAssignments (std::unordered_map< std::string, Category > &alt_assignment) |
| |
| Category | getAlternativeAssignment (std::string altName) const |
| |
| void | setAlternativeAssignment (std::string altName, Category &cat) |
| |
| int | getNumberCats () |
| |
| std::pair< float, float > | getBoundaries () |
| |
| | PerformanceTable (std::vector< std::vector< Perf >> &perf_vect, std::string mode="alt") |
| |
| | PerformanceTable (int nb_of_perfs, Criteria &crits, std::string prefix="alt") |
| |
| | PerformanceTable (const PerformanceTable &perfs) |
| |
| void | generateRandomPerfValues (unsigned long int seed=time(NULL), int lower_bound=0, int upper_bound=1) |
| |
| std::vector< std::vector< Perf > > | getPerformanceTable () const |
| |
| std::string | getMode () const |
| |
| bool | isSorted () const |
| |
| std::vector< Perf > | operator[] (std::string name) |
| |
| Perf | getPerf (std::string name, std::string crit) |
| |
| void | sort (std::string mode="crit") |
| |
| void | changeMode (std::string mode) |
| |
| std::vector< Perf > | getAltBetweenSorted (std::string critId, float inf, float sup) |
| |
| std::vector< Perf > | getAltBetween (std::string critId, float inf, float sup) |
| |
| std::vector< Perf > | getBestPerfByCrit (Criteria &crits) |
| |
| std::vector< Perf > | getWorstPerfByCrit (Criteria &crits) |
| |
| bool | isAltInTable (std::string altName) |
| |
| int | getNumberCrit () |
| |
| int | getNumberAlt () |
| |
| void | display () |
| |
| bool | operator== (const PerformanceTable &pt) const |
| |
|
|
std::vector< std::vector< Perf > > | pt_ |
| |
|
std::string | mode_ = "alt" |
| |
|
bool | sorted_ = false |
| |
Dataset datastructure.
The AlternativesPerformance class hold the datastructure that implement a complete dataset. An AlternativesPerformance object hold a PerformanceTable that represents the values of each alternative on each vriterion, and a hashmap that stores the ategory assignment for each alternatives. The hashmap is unordered and link the name of an alternative to the Category object to which it is assigned.
◆ AlternativesPerformance() [1/4]
| AlternativesPerformance::AlternativesPerformance |
( |
std::vector< std::vector< Perf >> & |
perf_vect, |
|
|
std::unordered_map< std::string, Category > & |
alt_assignment = default_map |
|
) |
| |
AlternativesPerformance standard constructor (PerformanceTable surcharged)
- Parameters
-
| perf_vect | Vector of performance |
| alt_assignment | Map of alternative to the assigned category. Default alternatives assigned to empty categories, but good practice would be to create the AlternativePerformance object with an AlternativeAssignment map, otherwise we should use PerformanceTable instead |
◆ AlternativesPerformance() [2/4]
| AlternativesPerformance::AlternativesPerformance |
( |
int |
nb_of_perfs, |
|
|
Criteria & |
crits, |
|
|
std::string |
prefix = "alt", |
|
|
std::unordered_map< std::string, Category > & |
alt_assignment = default_map |
|
) |
| |
AlternativesPerformance constructor without perf values but set of criteria to evaluate performance over (PerformanceTable surcharged)
- Parameters
-
| nb_of_perfs | Number of performance |
| crits | Criteria to evaluate performance over |
| prefix | Prefix to use for the name of each Performance created. Default = "alt" |
| alt_assignment | Map of alternative to the assigned category. Default alternatives assigned to empty categories, but good practice would be to create the AlternativePerformance object with an AlternativeAssignment map, otherwise we should use PerformanceTable instead |
◆ AlternativesPerformance() [3/4]
| AlternativesPerformance::AlternativesPerformance |
( |
const PerformanceTable & |
perf_table, |
|
|
std::unordered_map< std::string, Category > & |
alt_assignment = default_map |
|
) |
| |
AlternativesPerformance constructor using an existing performance table
- Parameters
-
| perf_table | Performance table to copy |
| alt_assignment | Map of alternative assignements to categories Default alternatives assigned to empty categories, but good practice would be to create the AlternativePerformance object with an AlternativeAssignment map, otherwise we should use PerformanceTable instead |
◆ AlternativesPerformance() [4/4]
◆ getAlternativeAssignment()
| Category AlternativesPerformance::getAlternativeAssignment |
( |
std::string |
altName | ) |
const |
getAlternative getter of the assignment of one specified alternative
- Parameters
-
| altName | name of the alternative of which the assignment is requested |
- Returns
- assignment of the alternative
◆ getAlternativesAssignments()
| std::unordered_map<std::string, Category> AlternativesPerformance::getAlternativesAssignments |
( |
| ) |
const |
getAlternativesPerformanceMap getter of the alternatives assignments
- Returns
- alt_assignment_
◆ getBoundaries()
| std::pair<float, float> AlternativesPerformance::getBoundaries |
( |
| ) |
|
getBoundaries return the boundaries of the dataset: the minimal value and the maximal value found
- Returns
- boudary_pair with first the minimal value, and second the maximal value
◆ getNumberCats()
| int AlternativesPerformance::getNumberCats |
( |
| ) |
|
getNumberCats compute the number of unique category in the dataset
- Returns
- n_cats
◆ setAlternativeAssignment()
| void AlternativesPerformance::setAlternativeAssignment |
( |
std::string |
altName, |
|
|
Category & |
cat |
|
) |
| |
setAlternative getter of the assignment of one specified alternative
- Parameters
-
| altName | name of the alternative the category will be assigned to |
| cat | category to assign |
◆ setAlternativesAssignments()
| void AlternativesPerformance::setAlternativesAssignments |
( |
std::unordered_map< std::string, Category > & |
alt_assignment | ) |
|
setAlternativesPerformanceMap getter of the alternatives assignments
- Parameters
-
| alt_assignment | assignment map |
The documentation for this class was generated from the following file: