Bottom-Left Placement Heuristic. More...
#include <rplacementbottomleft.h>
Public Member Functions | |
RPlacementBottomLeft (size_t maxobjs, bool calc, bool use, RRandom &r, RParamStruct *dist, RParamStruct *area, bool firstrandom, bool ori) | |
virtual void | Init (RProblem2D *prob, RLayout *layout, RGrid *grid) |
virtual void | SearchValidPositions (RGeoInfo *info) |
virtual void | PostPlace (RGeoInfo *info, const RPoint &pos) |
Public Member Functions inherited from RPlacementHeuristic | |
RPlacementHeuristic (size_t maxobjs, bool calc, bool use, RRandom &r, RParamStruct *dist, RParamStruct *area, bool firstrandom, bool ori) | |
RGeoInfo * | NextObject (void) |
void | Run (RProblem2D *prob, RLayout *layout, RGrid *grid) |
void | AddValidPosition (RPoint &pos) |
virtual void | PostRun (void) |
RRect | GetResult (void) |
double | GetDistances (void) |
bool | IsEnd (void) |
size_t | GetNbObjsOk (void) |
RFreePolygons * | GetFreePolygons (void) |
RLayout * | GetLayout (void) const |
virtual | ~RPlacementHeuristic (void) |
Private Attributes | |
RPoint | NextObj |
RPoint | NextLine |
Additional Inherited Members | |
Protected Member Functions inherited from RPlacementHeuristic | |
virtual RGeoInfo * | SelectNextObject (void) |
Protected Attributes inherited from RPlacementHeuristic | |
RRandom & | Random |
RGrid * | Grid |
RLayout * | Layout |
RSize | Limits |
bool | WeightedDistances |
size_t | NbObjs |
size_t | NbObjsOk |
RRect | Result |
double | Distances |
RGeoInfo ** | Order |
RGeoInfo * | CurInfo |
RFreePolygons | Free |
bool | CalcFree |
bool | UseFree |
bool | AllOri |
RContainer< ObjectPos, true, false > | ValidPos |
RPromKernel | Prom |
RPromCriterion * | Dist |
const RParam * | DistParams |
RPromCriterion * | Area |
const RParam * | AreaParams |
bool | FirstRandom |
Detailed Description
Bottom-Left Placement Heuristic.
This class implements a bottom-left heuristic. This heuristic handles objects "line after line". The first object is place in bottom-left part of the rectangle representing the limits. After that, the heuristic try to place so much objects as possible to the right of the first object. When it is not more possible, the next object is place top of the first one. The heuristic try then to put the rest of the objects to the right and so on.
Constructor & Destructor Documentation
RPlacementBottomLeft | ( | size_t | maxobjs, |
bool | calc, | ||
bool | use, | ||
RRandom & | r, | ||
RParamStruct * | dist, | ||
RParamStruct * | area, | ||
bool | firstrandom, | ||
bool | ori | ||
) |
Construct the bottom-left heuristic.
- Parameters
-
maxobjs Maximal number of objects to place. calc Must free polygons be calculated. use Must free polygons be used. r The random generator to use. dist Distance criteria parameters. area Area criteria parameters. firstrandom Must the first object be placed randomly? ori Must all orientation be tested.
Member Function Documentation
|
virtual |
Initialize the heuristic.
- Parameters
-
prob The problem. layout Layout. grid Grid.
Reimplemented from RPlacementHeuristic.
|
virtual |
Calculate all the possible positions to place a given object. The method must register these valid positions with the 'AddValidPosition' method.
- Parameters
-
info Geometric information representing the object placed.
Implements RPlacementHeuristic.
This method is called each time a given object is placed at a given position. It can be used to make some specific computational updates.
This method must update Result, the rectangle bounding all placed objects.
- Parameters
-
info Geometric information representing the object placed. pos The position where it is placed.
Implements RPlacementHeuristic.
Member Data Documentation
|
private |
Position where to place the next object.
|
private |
Where the next line begin.