First Node Heuristic. More...
#include <rhga.h>
Inheritance diagram for RFirstNodeHeuristic< cNode, cObj, cNodes >:
Collaboration diagram for RFirstNodeHeuristic< cNode, cObj, cNodes >:
Public Member Functions | |
RFirstNodeHeuristic (RRandom &r, RCursor< cObj > objs, RDebug *debug=0) | |
virtual void | Init (cNodes *nodes) |
virtual cNode * | NewNode (const RAttrList &attr, cNode *parent) |
virtual cNode * | FindNode (void) |
virtual | ~RFirstNodeHeuristic (void) |
Public Member Functions inherited from RTreeHeuristic< cNode, cObj, cNodes > | |
RTreeHeuristic (const RString &n, RRandom &r, RCursor< cObj > objs, RDebug *debug=0) | |
const RString | GetName (void) const |
void | BuildFile (const RString &name, cObj *obj) |
virtual void | SelectNextObject (void) |
cObj * | GetNextObject (void) |
cNode * | GetNode (void) |
void | PutNextObject (void) |
void | Run (cNodes *nodes) |
virtual void | PostRun (void) |
bool | IsEnd (void) |
size_t | GetNbObjsOk (void) |
long | RRand (long max) |
template<class T > | |
void | RandOrder (T *arr, size_t size) |
virtual | ~RTreeHeuristic (void) |
Private Attributes | |
cNode ** | tmpNodes |
RAttrList | tmpAttrs |
Additional Inherited Members | |
Protected Attributes inherited from RTreeHeuristic< cNode, cObj, cNodes > | |
RString | Name |
RRandom & | Random |
RCursor< cObj > | Objs |
size_t | NbObjs |
size_t | NbObjsOk |
cNodes * | Nodes |
cObj ** | Order |
cObj * | CurObj |
cNode * | CurNode |
RDebug * | Debug |
Detailed Description
template<class cNode, class cObj, class cNodes>
singleton R::RFirstNodeHeuristic< cNode, cObj, cNodes >
First Node Heuristic.
The RFitstNodeHeuristic class provides a first fit heuristic for trees.
Starting from the root node, the heuristic tries to find a branch where an object can be attached. It tries to find the highest node in the tree. If necessary, an intermediate node is created.
Constructor & Destructor Documentation
RFirstNodeHeuristic | ( | RRandom & | r, |
RCursor< cObj > | objs, | ||
RDebug * | debug = 0 |
||
) |
Construct the grouping heuristic.
- Parameters
-
r The random generator to use. objs Pointer to the objects. debug Debugger.
|
virtual |
Destruct the heuristic.
Member Function Documentation
|
virtual |
Initialize the heuristic.
- Parameters
-
nodes Pointer to the nodes.
Reimplemented from RTreeHeuristic< cNode, cObj, cNodes >.
|
virtual |
Create a new child node to the current node with the set of attributes to place.
- Parameters
-
attr Attributes for the node. parent Parent node.
|
virtual |
Find a node where to attach the next object to treat.
- Returns
- Pointer to the node.
Implements RTreeHeuristic< cNode, cObj, cNodes >.
Member Data Documentation
|
private |
Temporary array of nodes.
|
private |
Temporary list of attributes.