NNGGA Heuristic. More...
#include <rheuristicnn.h>
Public Member Functions | |
RHeuristicNN (R::RRandom &r, R::RCursor< cObj > objs, RParamsNN *params, R::RDebug *debug=0) | |
virtual void | Init (cGroups *groups) |
virtual cGroup * | FindGroup (cObj *obj) |
virtual void | PostRun (void) |
Public Member Functions inherited from RGroupingHeuristic< cGroup, cObj, cGroups > | |
RGroupingHeuristic (const RString &n, RRandom &r, RCursor< cObj > objs, RDebug *debug=0) | |
const RString | GetName (void) const |
virtual void | BuildOrder (void) |
void | Run (cGroups *groups) |
bool | IsEnd (void) |
size_t | GetNbObjsOk (void) |
long | RRand (long max) |
template<class T > | |
void | RandOrder (T *arr, size_t size) |
virtual | ~RGroupingHeuristic (void) |
Private Attributes | |
RContainer< cGroup, false, false > | ToDel |
RContainer< cObj, false, false > | ToReAssign |
RParamsNN * | Params |
RContainer< Local, true, false > | NbNearestNeighbors |
size_t | NbPossibleGrps |
Additional Inherited Members | |
Protected Attributes inherited from RGroupingHeuristic< cGroup, cObj, cGroups > | |
RString | Name |
RRandom & | Random |
RCursor< cObj > | Objs |
size_t | NbObjs |
size_t | NbObjsOk |
cGroups * | Groups |
cObj ** | Order |
RDebug * | Debug |
Detailed Description
template<class cGroup, class cObj, class cGroups>
class R::RHeuristicNN< cGroup, cObj, cGroups >
NNGGA Heuristic.
The RHeuristicNN class provides a specific heuristic for the Nearest Neighbors Grouping Genetic Algorithm.
Constructor & Destructor Documentation
RHeuristicNN | ( | R::RRandom & | r, |
R::RCursor< cObj > | objs, | ||
RParamsNN * | params, | ||
R::RDebug * | debug = 0 |
||
) |
Construct the heuristic.
- Parameters
-
r The random generator to use. objs Pointer to the objects. params Parameters. debug Debugger.
Member Function Documentation
|
virtual |
Initialize the heuristic.
- Parameters
-
groups Pointer to the groups.
Reimplemented from RGroupingHeuristic< cGroup, cObj, cGroups >.
|
virtual |
Find a group for the next object.
- Parameters
-
obj Object.
Implements RGroupingHeuristic< cGroup, cObj, cGroups >.
|
virtual |
Verify that no social object is alone and that all the groups has to minimum number of objects.
Reimplemented from RGroupingHeuristic< cGroup, cObj, cGroups >.
Member Data Documentation
|
private |
Groups to delete because they contain only one "social" object.
|
private |
Objects to reassigned.
|
private |
Parameters of the SCGA.
|
private |
Container that count the number of nearest neighbors
|
private |
Hold the number of possible groups for all objects to group.