NNGGA Instance. More...

#include <rinstnn.h>

Inheritance diagram for RInstNN< cInst, cChromo, cThreadData, cGroup, cObj >:
[legend]
Collaboration diagram for RInstNN< cInst, cChromo, cThreadData, cGroup, cObj >:
[legend]

Public Member Functions

 RInstNN (RCursor< cObj > objs, RParamsNN *p, RDebug *debug)
 
virtual R::RGroupingHeuristic
< cGroup, cObj, cChromo > * 
CreateHeuristic (void)
 
virtual bool StopCondition (void)
 
void WriteChromoInfo (cChromo *c)
 
virtual void PostEvaluate (void)
 
virtual const RMaxVectorGetDisagreementRatios (const cObj *obj) const =0
 
virtual const RMaxVectorGetAgreementRatios (const cObj *obj) const =0
 
virtual const RMaxVectorGetSims (const cObj *obj) const =0
 
virtual bool IsSocial (const cObj *obj)
 
virtual void PostRun (void)
 
virtual void HandlerNotFound (const R::RNotification &notification)
 
virtual ~RInstNN (void)
 
- Public Member Functions inherited from RInstG< cInst, cChromo, RFitnessNN, cThreadData, cGroup, cObj >
 RInstG (size_t popsize, RCursor< cObj > objs, const RString &h, const RString &name, RDebug *debug=0)
 
virtual void Init (void)
 
RString GetHeuristic (void) const
 
bool MustLocalOptimisation (void) const
 
void SetLocalOptimisation (bool localopti)
 
bool GetEmptyModifiedGroups (void) const
 
void SetEmptyModifiedGroups (bool empty)
 
RCursor< cObj > GetObjs (void) const
 
virtual void AnalyzePop (void)
 
virtual void RandomConstruct (void)
 
virtual void Crossover (void)
 
virtual void Mutation (void)
 
virtual void Inversion (void)
 
virtual ~RInstG (void)
 
- Public Member Functions inherited from RInst< cInst, cChromo, RFitnessNN, cThreadData >
 RInst (size_t popsize, const RString &name, RDebug *debug=0)
 
virtual RCString GetClassName (void) const
 
void SetMutationParams (size_t agemut, size_t agebestmut, size_t nbmut)
 
void SetVerify (bool verify)
 
bool GetVerify (void) const
 
bool MustOptimisation (void) const
 
void SetOptimisation (bool opti)
 
cChromo * GetBestChromosome (void) const
 
void SetSeed (int seed)
 
int GetSeed (void) const
 
virtual void DisplayInfos (void)
 
virtual void StrongMutation (void)
 
void Generation (void)
 
virtual void Run (void)
 
virtual void Verify (void)
 
long RRand (long max)
 
void RandOrder (T *array, size_t size)
 
virtual ~RInst (void)
 
- Public Member Functions inherited from RObject
 RObject (const RString &name=RString::Null)
 
int Compare (const RObject &obj) const
 
RString GetName (void) const
 
void PostNotification (const hNotification handle)
 
void PostNotification (const RCString &name)
 
void PostNotification (const hNotification handle, T data)
 
void PostNotification (const RCString &name, T data)
 
void InsertObserver (tNotificationHandler handler, const hNotification handle, RObject *object)
 
void InsertObserver (tNotificationHandler handler, const RCString &name, RObject *object)
 
void InsertObserver (tNotificationHandler handler, const hNotification handle)
 
void InsertObserver (tNotificationHandler handler, const RCString &name)
 
void InsertObserver (tNotificationHandler handler, RObject *object)
 
void InsertObserver (tNotificationHandler handler)
 
void DeleteObserver (void)
 
void DeleteObserver (const hNotification handle, RObject *object)
 
void DeleteObserver (const RCString &name, RObject *object)
 
hNotification GetNotificationHandle (const RCString &name) const
 
RCString GetNotificationName (const hNotification handle) const
 
virtual ~RObject (void)
 
- Public Member Functions inherited from iRInst
size_t GetPopSize (void) const
 
size_t GetGen (void) const
 
size_t GetAgeBest (void) const
 
size_t GetAgeBestPop (void) const
 
virtual ~iRInst (void)
 
- Public Member Functions inherited from RPromKernelNN< cChromo >
 RPromKernelNN (RParamsNN *p, size_t nbsols)
 
void AssignChromo (RPromSol *s, cChromo *c)
 
void AssignSol (RPromSol *s, double sim, double agree, double disagree)
 
- Public Member Functions inherited from RPromKernel
 RPromKernel (const char *name, size_t sol, size_t crit)
 
void ComputeEvalFunc (void)
 
virtual void ComputePrometheeII (void)
 
void AddCriterion (RPromCriterion *crit)
 
RPromCriterionGetCriterion (const RString &name) const
 
RPromCriterionGetCriterion (const size_t id) const
 
void AddSol (RPromSol *sol)
 
virtual RPromSolNewSol (void)
 
virtual RPromSolNewSol (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 RPromSolGetBestSol (void)
 
RCursor< RPromSolGetSols (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)
 

Protected Attributes

RParamsNNParams
 
RPromSol ** Sols
 
RContainer< cObj, false, true > NoSocialObjs
 
- Protected Attributes inherited from RInstG< cInst, cChromo, RFitnessNN, cThreadData, cGroup, cObj >
RString Heuristic
 
bool EmptyModifiedGroups
 
RContainer< cObj, false, false > Objs
 
size_t MaxGroups
 
bool DoLocalOptimisation
 
- Protected Attributes inherited from RInst< cInst, cChromo, RFitnessNN, cThreadData >
cThreadData ** thDatas
 
bool bRandomConstruct
 
bool VerifyGA
 
bool DoPostEvaluation
 
bool DoOptimisation
 
- Protected Attributes inherited from RObject
RString Name
 
- Protected Attributes inherited from iRInst
size_t PopSize
 
size_t Gen
 
size_t AgeBest
 
size_t AgeBestPop
 
bool Pause
 

Additional Inherited Members

- Static Public Member Functions inherited from RInst< cInst, cChromo, RFitnessNN, cThreadData >
static int sort_function_cChromosome (const void *a, const void *b)
 
- Public Attributes inherited from RInst< cInst, cChromo, RFitnessNN, cThreadData >
RDebugDebug
 
RRandom Random
 
cChromo ** Chromosomes
 
cChromo ** Ranked
 
cChromo * BestChromosome
 
cChromo * BestInPop
 
- Static Public Attributes inherited from RInst< cInst, cChromo, RFitnessNN, cThreadData >
static const char instMaster
 
static const char instSlave
 
static const char instMultiProcess
 
static const char instMultiComputers
 
static const char instMultiEchos
 
- Protected Member Functions inherited from iRInst
 iRInst (size_t popsize)
 

Detailed Description

template<class cInst, class cChromo, class cThreadData, class cGroup, class cObj>
class R::RInstNN< cInst, cChromo, cThreadData, cGroup, cObj >

NNGGA Instance.

The instance of the Nearest Neighbors Grouping Genetic Algorithm.

Constructor & Destructor Documentation

RInstNN ( RCursor< cObj >  objs,
RParamsNN p,
RDebug debug 
)

Construct the instance.

Parameters
objsThe objects to group.
pParameters.
debugDebugger.
virtual ~RInstNN ( void  )
virtual

Destruct the instance.

Member Function Documentation

virtual R::RGroupingHeuristic<cGroup,cObj,cChromo>* CreateHeuristic ( void  )
virtual

Create a specific heuristic for the algorithm.

Reimplemented from RInstG< cInst, cChromo, RFitnessNN, cThreadData, cGroup, cObj >.

virtual bool StopCondition ( void  )
virtual

This function determines if the GA must be stopped. Actually, it is the case when the maximal number of generation is calculated.

Returns
The function returns true if the GA must stop.

Implements RInst< cInst, cChromo, RFitnessNN, cThreadData >.

void WriteChromoInfo ( cChromo *  c)

Write the information of a given chromosome.

Parameters
cChromosome.
virtual void PostEvaluate ( void  )
virtual

Apply PROMETHEE to classify the chromosomes.

Reimplemented from RInst< cInst, cChromo, RFitnessNN, cThreadData >.

virtual const RMaxVector* GetDisagreementRatios ( const cObj *  obj) const
pure virtual

Get the maximum disagreement ratios of an element.

Parameters
objElement.
virtual const RMaxVector* GetAgreementRatios ( const cObj *  obj) const
pure virtual

Get the disagreement ratio between two elements.

Parameters
objElement.
virtual const RMaxVector* GetSims ( const cObj *  obj) const
pure virtual

Compute the similarity between two elements.

Parameters
objElement.
virtual bool IsSocial ( const cObj *  obj)
virtual

Verify if the object is a social one.

Parameters
objObject.
Returns
false by default.
virtual void PostRun ( void  )
virtual

This function can be used to do a treatment after the GA stops.

Reimplemented from RInst< cInst, cChromo, RFitnessNN, cThreadData >.

virtual void HandlerNotFound ( const R::RNotification notification)
virtual

Called when no handler was found for a given notification.

Reimplemented from RInst< cInst, cChromo, RFitnessNN, cThreadData >.

Member Data Documentation

RParamsNN* Params
protected

Parameter of the GA.

RPromSol** Sols
protected

Solutions corresponding to the chromosome.

RContainer<cObj,false,true> NoSocialObjs
protected

Social objects.