2D GA chromosome. More...
#include <rga2d.h>
Public Member Functions | |
RChromo2D (cInst *inst, size_t id) | |
virtual void | Init (cThreadData *thData) |
virtual void | RandomConstruct (void) |
virtual void | Crossover (cChromo *parent1, cChromo *parent2) |
virtual void | Mutation (void) |
virtual void | Verify (void) |
virtual void | Copy (const cChromo &chromo) |
RObj2D * | GetObj (tCoord X, tCoord Y) |
cInfo * | GetInfo (tCoord X, tCoord Y) |
RPoint & | GetActLimits (void) |
virtual | ~RChromo2D (void) |
Public Member Functions inherited from RChromo< cInst, cChromo, cFit, cThreadData > | |
RChromo (cInst *inst, size_t id) | |
virtual void | Evaluate (void) |
virtual void | StrongMutation (void) |
virtual void | Inversion (void) |
virtual void | Optimisation (void) |
virtual void | Print (void) |
virtual | ~RChromo (void) |
Public Member Functions inherited from RLayout | |
RLayout (RProblem2D *prob, bool create) | |
void | Boundary (RRect &rect) |
void | ClearInfos (void) |
void | Copy (const RLayout &infos, RGrid *grid) |
RProblem2D * | GetProblem (void) const |
RGeoInfo * | operator[] (size_t id) |
const RGeoInfo * | operator[] (size_t id) const |
const RGeoInfo * | GetBoard (void) const |
void | GetTab (RGeoInfo **tab) |
RCursor< RGeoInfo > | GetInfos (void) const |
size_t | GetNbAggregators (void) const |
RCursor< RGeoInfoConnection > | GetConnections (void) const |
RObj2DContainer * | GetNewAggregator (void) |
void | DestroyAggregators (void) |
tCoord | ComputeDist (RGeoInfo *info, bool weight, const RPoint &pos) |
RGeoInfo * | GetMostConnected (RGeoInfo **order, size_t nbobjs, size_t nbok, bool weight) |
void | FillAggregator (RObj2DContainer *cont, bool *selected, RPromKernel *kernel, RRandom &random, bool weight) |
tCoord | ComputeConnections (bool weight) |
RRect | ComputeBoundary (void) |
virtual | ~RLayout (void) |
Protected Attributes | |
RSize | ActLimits |
RPlacementHeuristic * | Heuristic |
RGrid * | Grid |
bool * | Selected |
RPromKernel * | Kernel |
Protected Attributes inherited from RLayout | |
RProblem2D * | Problem |
RGeoInfo | Board |
RContainer< RGeoInfoConnection, true, false > | PlacedConnections |
size_t | NbAggregators |
Additional Inherited Members | |
Public Attributes inherited from RChromo< cInst, cChromo, cFit, cThreadData > | |
cInst * | Instance |
size_t | Id |
cFit * | Fitness |
bool | ToEval |
Detailed Description
template<class cInst, class cChromo, class cFit, class cThreadData, class cInfo>
singleton R::RChromo2D< cInst, cChromo, cFit, cThreadData, cInfo >
2D GA chromosome.
This class represents a chromosome for the 2D placement GA.
Constructor & Destructor Documentation
RChromo2D | ( | cInst * | inst, |
size_t | id | ||
) |
Construct the chromosome.
- Parameters
-
inst Pointer to the instance. id Identifier of the chromosome.
|
virtual |
Destruct the chromosome.
Member Function Documentation
|
virtual |
This function initializes some important data, in particular Infos and Selected.
- Parameters
-
thData Pointer to the "thread-dependent" data of the chromosome.
Reimplemented from RChromo< cInst, cChromo, cFit, cThreadData >.
|
virtual |
The random construction uses the heuristic to place all the objects.
Reimplemented from RChromo< cInst, cChromo, cFit, cThreadData >.
|
virtual |
Make the crossover for the chromosome. A set of objects is taken from the first parent. Then, the heuristic is used to place this object and the objects that aren't selected.
- Parameters
-
parent1 First parent used. parent2 Second parent used.
Reimplemented from RChromo< cInst, cChromo, cFit, cThreadData >.
|
virtual |
The mutation simply calls the heuristic with all the objects.
Reimplemented from RChromo< cInst, cChromo, cFit, cThreadData >.
|
virtual |
This function verify the validity of the chromosome, in particular that no polygons are overlapped.
Reimplemented from RChromo< cInst, cChromo, cFit, cThreadData >.
|
virtual |
The method copies a chromosome into another.
- Parameters
-
chromo Chromosome.
Reimplemented from RChromo< cInst, cChromo, cFit, cThreadData >.
Gives the object at position (X,Y).
- Parameters
-
X X Position. Y Y Position.
- Returns
- The function returns a pointer to the objects or 0.
Gives the geometric information of the object at position (X,Y).
- Parameters
-
X X Position. Y Y Position.
- Returns
- The function returns a pointer to the information or 0.
RPoint& GetActLimits | ( | void | ) |
Return the actual limits of the chromosome.
Member Data Documentation
|
protected |
The actual limits of the solution represented by the chromosome.
|
protected |
Heuristic used for the placement.
|
protected |
A Grid representing the current placement.
|
protected |
Temporary array to remember which objects are selected.
|
protected |
PROMETHEE kernel.