PROMETHEE Kernel. More...
#include <rpromkernel.h>
Public Member Functions | |
RPromKernel (const char *name, size_t sol, size_t crit) | |
void | ComputeEvalFunc (void) |
virtual void | ComputePrometheeII (void) |
void | AddCriterion (RPromCriterion *crit) |
RPromCriterion * | GetCriterion (const RString &name) const |
RPromCriterion * | GetCriterion (const size_t id) const |
void | AddSol (RPromSol *sol) |
virtual RPromSol * | NewSol (void) |
virtual RPromSol * | NewSol (const RString &name) |
size_t | GetNbSols (void) const |
virtual void | Assign (RPromSol *sol, RPromCriterion *crit, const double v) |
virtual void | Assign (const RString &sol, RPromCriterion *crit, const double v) |
virtual void | Assign (RPromSol *sol, const RString &crit, const double v) |
virtual void | Assign (const RString &sol, const RString &crit, const double v) |
const RPromSol * | GetBestSol (void) |
RCursor< RPromSol > | GetSols (void) |
void | CopySols (RContainer< RPromSol, false, false > &sols) |
double | GetMinFi (void) |
double | GetMaxFi (void) |
size_t | GetBestSolId (void) |
void | Clear (void) |
void | ClearSols (void) |
void | Print (bool normalized) |
virtual | ~RPromKernel (void) |
Private Member Functions | |
void | OrderSolutions (void) |
Static Private Member Functions | |
static int | sort_function_solutions (const void *a, const void *b) |
Private Attributes | |
RString | Name |
RContainer< RPromSol, true, true > | Solutions |
RContainer< RPromSol, false, false > | OrderedSolutions |
RContainer< RPromCriterion, true, true > | Criteria |
bool | MustReOrder |
Detailed Description
PROMETHEE Kernel.
The RPromKernel provides a kernel to manage PROMETHEE session.
Constructor & Destructor Documentation
RPromKernel | ( | const char * | name, |
size_t | sol, | ||
size_t | crit | ||
) |
Construct the kernel.
- Parameters
-
name The name of the kernel. sol Initial maximal number of solutions. crit Initial maximal number of criteria.
|
virtual |
Destruct the kernel.
Member Function Documentation
void ComputeEvalFunc | ( | void | ) |
Compute the evaluation functions for the solutions.
|
virtual |
Calculate PROMETHEE II.
void AddCriterion | ( | RPromCriterion * | crit | ) |
Add a new criterion.
- Parameters
-
crit Pointer to the new criterion.
RPromCriterion* GetCriterion | ( | const RString & | name | ) | const |
- Returns
- a pointer to a given criterion.
- Parameters
-
name Name of the criterion.
RPromCriterion* GetCriterion | ( | const size_t | id | ) | const |
- Returns
- a pointer to a given criterion.
- Parameters
-
id Identifier of the criterion.
void AddSol | ( | RPromSol * | sol | ) |
Add a solution to the PROMETHEE kernel. Each solution must have an unique identifier. A way to manage that is to assign to each solution added an identifier equals to GetNbSols().
- Parameters
-
sol Solution to add.
|
virtual |
Create a new solution.
Create a new solution.
- Parameters
-
name Name of the solution.
size_t GetNbSols | ( | void | ) | const |
- Returns
- the number of solutions managed by the kernel.
|
virtual |
Assign a value to a criterion.
- Parameters
-
sol Pointer to the solution. crit Pointer to the criterion. v Value.
|
virtual |
Assign a value to a criterion.
- Parameters
-
sol Name of to the solution. crit Pointer to the criterion. v Value.
Assign a value to a criterion.
- Parameters
-
sol Pointer to the solution. crit Name of the criterion. v Value.
Assign a value to a criterion.
- Parameters
-
sol Name of the solution. crit Name of the criterion. v Value.
|
staticprivate |
Function used to sort the solutions by fit.
- Parameters
-
a Pointer to the first solution. b Pointer to the second solution.
|
private |
Order the solutions by descending order of their fitness.
const RPromSol* GetBestSol | ( | void | ) |
- Returns
- the best solution.
- Returns
- a cursor over the solutions ordered descending by their fitness.
void CopySols | ( | RContainer< RPromSol, false, false > & | sols | ) |
Copy the solutions ordered descending by their fitness into a container.
- Parameters
-
sols Container holding the results.
double GetMinFi | ( | void | ) |
- Returns
- the Fi of the worst solution.
double GetMaxFi | ( | void | ) |
- Returns
- the Fi of the best solution.
size_t GetBestSolId | ( | void | ) |
Return the best solution identifier.
void Clear | ( | void | ) |
Clear the kernel.
void ClearSols | ( | void | ) |
Clear the solutions of the kernel.
void Print | ( | bool | normalized | ) |
Print the solutions ordered on screen.
- Parameters
-
normalized Show the values normalized or not.
Member Data Documentation
|
private |
The name of the kernel.
|
private |
Solutions.
|
private |
Solutions ordered by fitness.
|
private |
Criteria.
|
private |
Look if the solution must be reordered (for example after a computing).