|
Project
|
utility functions used by our programs. More...
#include "../extsrc/pugixml/src/pugixml.hpp"#include "types/AlternativesPerformance.h"#include "types/Profiles.h"#include <matplot/matplot.h>#include "types/Category.h"#include "types/Criteria.h"#include "types/Perf.h"#include <algorithm>#include <chrono>#include <fstream>#include <iostream>#include <numeric>#include <random>#include <set>#include <stdio.h>#include <stdlib.h>#include <string>#include <sys/stat.h>#include <thread>#include <time.h>#include <typeinfo>#include <unistd.h>#include <unordered_map>#include <utility>#include <vector>
Go to the source code of this file.
Classes | |
| struct | simple_walker |
Functions | |
| template<typename T > | |
| std::ostream & | operator<< (std::ostream &out, const std::vector< T > &vec) |
| template<typename T > | |
| std::vector< T > | subVector (std::vector< T > const &v, int m, int n) |
| bool | fileExists (const std::string &name) |
| int | getRandomUniformInt (unsigned long int seed=0, int min=0, int max=100) |
| float | getRandomUniformFloat (unsigned long int seed=time(NULL), float min=0, float max=1) |
| std::vector< float > | randomCategoriesLimits (int nbCategories, unsigned long int seed=time(NULL)) |
| std::vector< std::string > | getCriterionIds (std::vector< Perf > vectPerf) |
| Perf | getPerfOfCrit (std::vector< Perf > &vectPerf, std::string critId) |
| std::vector< std::string > | getNameIds (std::vector< Perf > vectPerf) |
| std::vector< Perf > | createVectorPerf (std::string id, Criteria &criteria, std::vector< float > &given_perf) |
| std::vector< Perf > | createVectorPerfWithNoPerf (std::string id, Criteria &criteria) |
| std::vector< double > | getPerfFromPerfVect (std::vector< Perf > &p) |
| bool | checkKey (std::unordered_map< int, int > &map, int key) |
| void | plotGlobalData (AlternativesPerformance &ap) |
| void | plotProfile (Profiles &p) |
utility functions used by our programs.
All utility fonctions are referenced and implemented inside this file.
|
inline |
Check if a key is present in a unordered map
| map | unordered map of <int,int> |
|
inline |
createVectorPerf creates a vector of performances given the id, criteria and values
| id | of the performance |
| criteria | criteria vector on which to associate the performances |
| given_perf | performances values in the same order as criteria vect |
createVectorPerf creates a vector of performances with random values given the id and criteria
| id | of the performance |
| criteria | criteria vector on which to associate the performances |
|
inline |
getCriterionIds get vector of criterions ids of a performance vector
| vectPerf | performance vector |
|
inline |
getNameIds get the names of each perfomance in a perfomance vector
| vectPerf | Performance vector from which we want the ids |
|
inline |
getPerfOfCrit get the performance for a given criterion in a performance vector.
| critId | criterion for which we want the perf |
|
inline |
Random float number generator
| seed | to initiate the generator, default 0 |
| min | min of generated number, default 0 |
| max | max of generated number, default 1 |
|
inline |
Random int number generator
| seed | to initiate the generator, default 0 |
| min | min of generated number, default 0 |
| max | max of generated number, default 100 |
| std::ostream& operator<< | ( | std::ostream & | out, |
| const std::vector< T > & | vec | ||
| ) |
Overloading << operator for std::vector object
| out | ostream |
| vec | std::vector object |
|
inline |
Plots data distribution for a AlternativesPerformance object in order to see if populations are separable. This is useful for ProfileInitialization for example.
| ap | AlternativesPerformance object |
|
inline |
|
inline |
randomCategoriesLimits creates random categories limits given the number of categories
| nbCategories | number of categories (and of limits) to create |
| seed | seed for random |
| std::vector<T> subVector | ( | std::vector< T > const & | v, |
| int | m, | ||
| int | n | ||
| ) |
subVector get a sub-vector of a vector
| v | vector from which we want the sub vector |
| m | index of the beginning of subvector |
| n | index of the end of subvector |