Choquet Integrals Tester. More...

#include <rtestchoquet.h>

Collaboration diagram for RTestChoquet:
[legend]

Public Member Functions

 RTestChoquet (size_t nbchoquets)
 
int GetMaxAbsVal (void) const
 
void SetNbCriteria (size_t choquet, size_t nb)
 
size_t GetNbCriteria (size_t choquet) const
 
size_t GetviId (size_t id, size_t i) const
 
size_t GetIijId (size_t id, size_t i, size_t j) const
 
ROptimizeChoquetGetBestSol (void) const
 
double vi (size_t id, size_t i) const
 
double Iij (size_t id, size_t i, size_t j) const
 
double GetComputedTime (void) const
 
size_t GetNbNodesEvaluated (void) const
 
void Run (int dom)
 
void Print (const RString &title, RTextFile *output, bool screen) const
 
virtual ~RTestChoquet (void)
 

Private Member Functions

virtual void Init (void)
 
virtual double Compute (RChoquetPropagator &prop)=0
 
virtual void AddConstraints (ROptimizeChoquet &home)
 

Private Attributes

size_t NbChoquets
 
Choquet * Choquets
 
int Domain
 
int Max
 
bool MustInit
 
double ElapsedSecs
 
ROptimizeChoquetCurSol
 
Gecode::BAB< ROptimizeChoquet > * Search
 
size_t Nbv
 
size_t NbI
 

Detailed Description

Choquet Integrals Tester.

The RTestChoquet class allows to find the parameters of one or more Choquet integrals that optimize a given cost function.

Constructor & Destructor Documentation

RTestChoquet ( size_t  nbchoquets)

Constructor.

Parameters
nbchoquetsNumber of Choquet integrals to optimize.
virtual ~RTestChoquet ( void  )
virtual

Destructor.

Member Function Documentation

int GetMaxAbsVal ( void  ) const

The method returns the maximum absolute value of the parameters of the current run.

void SetNbCriteria ( size_t  choquet,
size_t  nb 
)

Set the number of criteria for a given Choquet integral.

Parameters
choquetIdentifier of the Choquet integral.
nbNumber of parameters.
size_t GetNbCriteria ( size_t  choquet) const

Get the number of criteria for a given Choquet integral.

Parameters
choquetIdentifier of the Choquet integral.
Returns
the number of criteria.
size_t GetviId ( size_t  id,
size_t  i 
) const

Get the identifier of a given Shapley index for a particular Choquet integral.

Parameters
choquetIdentifier of the Choquet integral.
iIdentifier of the criteria.
Returns
the identifier.
size_t GetIijId ( size_t  id,
size_t  i,
size_t  j 
) const

Get the identifier of an interaction index for a particular Choquet integral.

Parameters
choquetIdentifier of the Choquet integral.
iIdentifier of the first criteria.
jIdentifier of the second criteria.
Returns
the identifier.
ROptimizeChoquet* GetBestSol ( void  ) const

Get the best solution computed.

Returns
a pointer.
double vi ( size_t  id,
size_t  i 
) const

Get the value of a given Shapley index for a particular Choquet integral of the best solution computed.

Parameters
idIdentifier of the Choquet integral
iIdentifier of the criteria.
Returns
the Shapley index.
double Iij ( size_t  id,
size_t  i,
size_t  j 
) const

Get the value of an interaction index for a particular Choquet integral of the best solution computed.

Parameters
idIdentifier of the Choquet integral
iIdentifier of the first criteria.
jIdentifier of the second criteria.
Returns
the interaction index.
double GetComputedTime ( void  ) const

Get the computed time of the last run.

Returns
the elapsed time in seconds.
size_t GetNbNodesEvaluated ( void  ) const

Get the number of nodes evaluated during the last run.

Returns
the number of nodes.
virtual void Init ( void  )
privatevirtual

Initialize the tester.

virtual double Compute ( RChoquetPropagator prop)
privatepure virtual

Compute the cost function to optimize for a given solution of parameter. This cost must be in [0,1].

This function must be overridden by inherited classes.

Parameters
propPropagator that holds the solution to evaluate.
Returns
the value of the cost function.
virtual void AddConstraints ( ROptimizeChoquet home)
privatevirtual

Add eventually some constraints between the criteria.

Parameters
homeSpace to optimize.
void Run ( int  dom)

Run the tester.

Parameters
domDomain of the parameter (numbers after the comma).
void Print ( const RString title,
RTextFile output,
bool  screen 
) const

Print the parameter values of the current solution.

Parameters
titleTitle to print (can be RString::Null).
outputIf not null, print the results in a text file.
screenSpecify if the results must be printed on the standard output.

Member Data Documentation

size_t NbChoquets
private

Number of Choquet integrals to optimize.

Choquet* Choquets
private

Structure containing information on each Choquet integral.

int Domain
private

Domain of the parameters. A domain of 2 supposes each parameters may have two digits after the comma.

int Max
private

Maximum value of the parameters.

bool MustInit
private

Specify if the class was already initialized or not.

double ElapsedSecs
private

Number of elapsed seconds of the last search.

ROptimizeChoquet* CurSol
private

Current optimal solution found.

Gecode::BAB<ROptimizeChoquet>* Search
private

Search engine used to navigate in the tree.

size_t Nbv
private

Total number of Shapley indexes to find.

size_t NbI
private

Total number of interaction indexes to find.