|
Project
|
Profiles data structure. More...
#include <Profiles.h>


Public Member Functions | |
| Profiles (std::vector< std::vector< Perf >> &perf_vect, std::string mode="crit") | |
| Profiles (int nb_of_prof, Criteria &crits, std::string mode="crit", std::string prefix="prof") | |
| Profiles (const Profiles &profiles) | |
| bool | isProfileOrdered () |
| void | generateRandomPerfValues (unsigned long int seed=time(NULL), int lower_bound=0, int upper_bound=1) |
| std::pair< std::vector< Perf >, std::vector< Perf > > | getBelowAndAboveProfile (std::string profName, float worst_value, float best_value) |
| void | setPerf (std::string name, std::string crit, float value) |
Public Member Functions inherited from PerformanceTable | |
| 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 |
Friends | |
| std::ostream & | operator<< (std::ostream &out, const Profiles &profs) |
Additional Inherited Members | |
Protected Attributes inherited from PerformanceTable | |
| std::vector< std::vector< Perf > > | pt_ |
| std::string | mode_ = "alt" |
| bool | sorted_ = false |
Profiles data structure.
The Profiles class hold the datastructure that implement the theoretical definition of a "profile": the values that delimit two categories. A Profiles object is represented as a PerformanceTable that guarantee the right order of the values. In order to have a correct representation of a set of profile (to delimit all the category of our problem), each profile must be dominated by the one above and must demonate the one below.
Example:
| crit0 | crit1 | ||
|---|---|---|---|
| category 2 | |||
| 0.6 | 0.8 | – profile 1 | |
| category 1 | |||
| 0.4 | 0.5 | – profile 0 | |
| category 0 |
| Profiles::Profiles | ( | std::vector< std::vector< Perf >> & | perf_vect, |
| std::string | mode = "crit" |
||
| ) |
Profiles standard constructor (PerformanceTable surcharged). Default mode is "crit"
| perf_vect | Vector of performance that models category limits or a PerformanceTable Profiles in "alt" |
| mode | refers the mode of the Profiles |
| Profiles::Profiles | ( | int | nb_of_prof, |
| Criteria & | crits, | ||
| std::string | mode = "crit", |
||
| std::string | prefix = "prof" |
||
| ) |
Profiles constructor without perf values but set of criteria to evaluate performance over (PerformanceTable surcharged) Default mode is "crit".
| Profiles::Profiles | ( | const Profiles & | profiles | ) |
Profiles constructor by copy
| perfs | Based performances to copy |
| void Profiles::generateRandomPerfValues | ( | unsigned long int | seed = time(NULL), |
| int | lower_bound = 0, |
||
| int | upper_bound = 1 |
||
| ) |
| std::pair<std::vector<Perf>, std::vector<Perf> > Profiles::getBelowAndAboveProfile | ( | std::string | profName, |
| float | worst_value, | ||
| float | best_value | ||
| ) |
getBelowAndAboveProfile gets the profiles below and above the given profile. If given profile is the first or last, it will return itself
| profId | id of the profile to get the above and below profiles |
| worst_value | worst value found in the dataset used to create the lower bound |
| best_value | best value found in the dataset used to create the higher bound |
| bool Profiles::isProfileOrdered | ( | ) |
isProfileOrdered checks if the profile performance table is ordered.
| void Profiles::setPerf | ( | std::string | name, |
| std::string | crit, | ||
| float | value | ||
| ) |
setPerf set a Perf given the alt name, crit and value. Unefficient since using [] operator... and should be avoided.
| name | name of the alt or profile we want to update |
| crit | name of the crit we want to update |
| value | new perf value |
|
friend |
Overloading << operator for Profile class
| out | ostream |
| profs | Profile object |