Structural deformable models
|
#include <Searcher.h>
Public Member Functions | |
Searcher () | |
Searcher (const Searcher &rhs) | |
~Searcher () | |
Searcher & | operator= (const Searcher &rhs) |
bool | step (float dt) |
void | evolve () |
void | startSearch (bool dostart=true) |
bool | searchDone () const |
template<class Iter > | |
unsigned int | getWinners (Iter iter) const |
std::map< dword, Winner > & | getWinList () |
const std::map< dword, Winner > & | getWinList () const |
float | getBestQOF () const |
float | getLeastQOF () const |
float | relativeQOF (float qof) const |
const Winner * | getWinner (dword id) const |
void | setExpectationMap (const ExpectationMap &em) |
ExpectationMap & | getExpectationMap () |
const ExpectationMap & | getExpectationMap () const |
void | clear () |
void | draw () const |
bool | triggerTest (int mx, int my, int what) |
operator bool () const | |
const Model & | getRepresentative () const |
void | reattachSensors () |
float | getGeneration (const Model *model) const |
void | setShapeWeight (float shapeweight) |
float | getShapeWeight () const |
Protected Types | |
enum | { MODE_PAUSE, MODE_RUN, MODE_DONE } |
Protected Member Functions | |
std::map< dword, Winner > & | updateWinList () |
int | getBindex (int bx, int by, bool &culled=*((bool *) NULL)) const |
int | getBindex (const PropVec &prop, bool &culled=*((bool *) NULL)) const |
int | getBindex (const Model &model, bool &culled=*((bool *) NULL)) const |
void | getQualityRange (float &lqof, float &hqof, float shapeweight=-1) const |
void | findWinners () |
bool | buildBins (float bindist=0.f) |
int | buildClusters () |
void | selectWinners () |
void | cleanFlags () |
std::list< Model * >::iterator & | remove (std::list< Model * >::iterator &mi) |
int | add (Model *m) |
Model & | mutate (Model &model, float rate=1) const |
int | distribute (int n=-1, float qth=0, bool count=false) |
Protected Attributes | |
Model | m_Representative |
PropVec | m_AvgWinner |
PropVec | m_StdWinner |
PropVec | m_MinModel |
PropVec | m_MaxModel |
ExpectationMap | m_EMap |
std::list< Model * > | m_Population |
int | m_NPop |
std::vector< MBin > | m_Bins |
int | m_BinsX |
int | m_BinsY |
float | m_BinDist |
std::list< MBin > | m_Clusters |
int | m_NClusters |
MBin * | m_CurCluster |
float | m_Time |
Point | m_PosMax |
Point | m_PosMin |
Point | m_PosRange |
enum Searcher:: { ... } | SMode |
dword | m_Mode |
float | m_EvolveT |
float | m_MutateRate |
std::map< dword, Winner > | m_Winners |
dword | m_NextWinID |
float | m_ShapeWeight |
Engine performing genetic search to determine a set of local winners.
Definition at line 16 of file Searcher.h.
|
protected |
Enumerator | |
---|---|
MODE_PAUSE | |
MODE_RUN | |
MODE_DONE |
Definition at line 79 of file Searcher.h.
Searcher::Searcher | ( | ) |
Definition at line 76 of file Searcher.cpp.
References getSearchPara(), m_EvolveT, m_MutateRate, SearcherParams::m_MutateRate, m_ShapeWeight, and SearcherParams::m_ShapeWeight.
Searcher::Searcher | ( | const Searcher & | rhs | ) |
Searcher::~Searcher | ( | ) |
Definition at line 90 of file Searcher.cpp.
References clear().
|
protected |
Definition at line 143 of file Searcher.cpp.
References Model::getFlags(), m_NPop, m_Population, m_Time, Model::m_TimeStamp, Model::setID(), Model::setInstCount(), and Winner::WID_EMPTY.
Referenced by distribute(), evolve(), and getShapeWeight().
|
protected |
Definition at line 361 of file Searcher.cpp.
References getBindex(), Model::getNNodes(), Model::getProperties(), getPropScale(), ExpectationMap::getRepresentative(), getSearchPara(), m_AvgWinner, m_BinDist, m_Bins, m_BinsX, m_BinsY, m_EMap, m_MaxModel, m_MinModel, m_Population, m_PosRange, SearcherParams::m_RelBinDist, m_Representative, m_ShapeWeight, m_StdWinner, MAXRAD, Model::ST_MEMBER, Point2D::sum(), Point2D::x, and Point2D::y.
Referenced by buildClusters(), and getShapeWeight().
|
protected |
Definition at line 419 of file Searcher.cpp.
References buildBins(), Model::DIST_CPOINTS, getBindex(), Model::getDataScale(), getPropDir(), getPropPos(), getPropScale(), getSearchPara(), m_BinDist, m_Bins, m_BinsX, SearcherParams::m_ClusterDDir, SearcherParams::m_ClusterDPos, SearcherParams::m_ClusterDScale, SearcherParams::m_ClusterMeltDist, m_Clusters, SearcherParams::m_ClusterTH, m_CurCluster, m_NClusters, SearcherParams::m_NClusters, M_PI, m_Population, m_Representative, mapAnglePI(), Model::ST_MEMBER, Point2D::x, and Point2D::y.
Referenced by evolve(), and getShapeWeight().
|
protected |
Definition at line 546 of file Searcher.cpp.
References VVector< T, D >::clampLB(), VVector< T, D >::clampUB(), DUMP, Model::getProperties(), Model::getQualityOfFit(), m_AvgWinner, m_MaxModel, m_MinModel, m_Population, m_Representative, m_StdWinner, m_Time, Model::m_TimeStamp, VVector< T, D >::sqrtEach(), Model::ST_DEL, Model::ST_LOOSER, Model::ST_MEMBER, Model::ST_NODEL, Model::ST_OLDSTATE, and Model::ST_WINNER.
Referenced by evolve(), and getShapeWeight().
void Searcher::clear | ( | ) |
Definition at line 126 of file Searcher.cpp.
References Model::clear(), ExpectationMap::clear(), m_Bins, m_BinsX, m_BinsY, m_EMap, m_EvolveT, m_NPop, m_Population, m_Representative, m_Time, and m_Winners.
Referenced by getExpectationMap(), operator=(), startSearch(), triggerTest(), and ~Searcher().
|
protected |
Definition at line 627 of file Searcher.cpp.
References add(), ExpectationMap::generateInstance(), Model::getNNodes(), Model::getProperties(), Model::getQualityOfFit(), ExpectationMap::getRepresentative(), m_AvgWinner, m_EMap, m_Representative, and m_StdWinner.
Referenced by getShapeWeight().
void Searcher::draw | ( | ) | const |
Definition at line 687 of file Searcher.cpp.
References Model::draw(), m_Population, m_Representative, and m_Winners.
Referenced by Brain::drawAllModels(), and getExpectationMap().
void Searcher::evolve | ( | ) |
Definition at line 163 of file Searcher.cpp.
References add(), buildClusters(), cleanFlags(), DUMP, ExpectationMap::generateInstance(), Model::getName(), Model::getQualityOfFit(), getQualityRange(), getSearchPara(), m_EMap, SearcherParams::m_EvolveCycle, EMDistribution::m_Integral, SearcherParams::m_MaxPop, m_Mode, m_MutateRate, SearcherParams::m_MutateSpawns, SearcherParams::m_MutateTHRed, m_NextWinID, m_NPop, SearcherParams::m_NSpawns, SearcherParams::m_NSpawnsTHRed, m_Population, m_Representative, m_Time, Winner::m_WinnerID, m_Winners, MODE_DONE, MODE_PAUSE, mutate(), NULL, ExpectationMap::ratePropVec(), selectWinners(), and Model::ST_NODEL.
Referenced by Brain::evolve().
|
protected |
Referenced by getShapeWeight().
|
inline |
Definition at line 129 of file Searcher.h.
References m_Population.
Referenced by getWinList(), and relativeQOF().
|
inlineprotected |
Definition at line 104 of file Searcher.h.
References m_BinsX, m_BinsY, and NULL.
Referenced by buildBins(), buildClusters(), getBindex(), and getShapeWeight().
|
inlineprotected |
Definition at line 116 of file Searcher.h.
References getBindex().
|
inlineprotected |
Definition at line 121 of file Searcher.h.
References getBindex(), Model::getCenter(), and setPropPos().
|
inline |
Definition at line 37 of file Searcher.h.
References m_EMap.
Referenced by MStructure::rebuildExpMap(), and Brain::setupSearch().
|
inline |
float Searcher::getGeneration | ( | const Model * | model | ) | const |
Definition at line 303 of file Searcher.cpp.
References getSearchPara(), SearcherParams::m_EvolveCycle, m_Time, and Model::m_TimeStamp.
Referenced by MStructure::addExpectation(), and getRepresentative().
|
inline |
Definition at line 135 of file Searcher.h.
References m_Population.
Referenced by getWinList(), and relativeQOF().
|
protected |
Definition at line 649 of file Searcher.cpp.
References m_Population, and setShapeWeight().
Referenced by evolve(), getShapeWeight(), and triggerTest().
|
inline |
Definition at line 43 of file Searcher.h.
References getGeneration(), m_Representative, and reattachSensors().
Referenced by Brain::triggerTest().
|
inline |
Definition at line 47 of file Searcher.h.
References add(), buildBins(), buildClusters(), cleanFlags(), distribute(), findWinners(), getBindex(), getQualityRange(), m_ShapeWeight, mutate(), NULL, selectWinners(), and updateWinList().
Referenced by MStructure::write().
Definition at line 30 of file Searcher.h.
References m_Winners.
Referenced by MStructure::addExpectation(), StructTable::findBestConnection(), and MStructure::verifyWinnerRating().
Definition at line 31 of file Searcher.h.
References getBestQOF(), getLeastQOF(), getWinner(), m_Winners, relativeQOF(), and setExpectationMap().
Definition at line 668 of file Searcher.cpp.
References m_Winners, and NULL.
Referenced by getWinList(), MStructure::getWinner(), and MStructure::verifyWinnerRating().
|
inline |
Definition at line 90 of file Searcher.h.
References m_Population.
Referenced by searchDone(), and Brain::triggerTest().
Definition at line 307 of file Searcher.cpp.
References Model::adaptProperties(), Model::adaptProportion(), Model::addNoise(), frand, FRAND1, Model::getProperties(), getSearchPara(), Model::getStdRadius(), M_PI, Model::push(), Model::pushRotate(), setPropDir(), and setPropPos().
Referenced by evolve(), and getShapeWeight().
|
inline |
Definition at line 95 of file Searcher.cpp.
References clear(), m_AvgWinner, m_BinDist, m_Bins, m_BinsX, m_BinsY, m_EMap, m_EvolveT, m_Mode, m_MutateRate, m_NextWinID, m_NPop, m_Population, m_PosMax, m_PosMin, m_PosRange, m_Representative, m_ShapeWeight, m_StdWinner, m_Time, m_Winners, and updateWinList().
Referenced by Searcher().
void Searcher::reattachSensors | ( | ) |
Definition at line 616 of file Searcher.cpp.
References ExpectationMap::getRepresentative(), m_EMap, m_Population, m_Representative, and Model::reattachSensors().
Referenced by getRepresentative().
|
inline |
Definition at line 141 of file Searcher.h.
References getBestQOF(), and getLeastQOF().
Referenced by getWinList().
Definition at line 152 of file Searcher.cpp.
References m_NPop, m_Population, and Model::ST_NODEL.
|
inline |
Definition at line 28 of file Searcher.h.
References getWinners(), m_Mode, and MODE_DONE.
|
protected |
Definition at line 513 of file Searcher.cpp.
References m_Clusters, m_Time, Model::ST_DEL, and TRACE.
Referenced by evolve(), and getShapeWeight().
void Searcher::setExpectationMap | ( | const ExpectationMap & | em | ) |
Definition at line 346 of file Searcher.cpp.
References ExpectationMap::correctLBUB(), EMDRect::getLB(), getPropPos(), EMDRect::getUB(), m_EMap, m_PosMax, m_PosMin, m_PosRange, EMDRect::setLB(), EMDRect::setUB(), and ExpectationMap::updateIntegral().
Referenced by getWinList(), main(), MStructure::rebuildExpMap(), and Brain::setupSearch().
|
inline |
Definition at line 46 of file Searcher.h.
References m_ShapeWeight.
Referenced by getQualityRange(), and MStructure::read().
void Searcher::startSearch | ( | bool | dostart = true | ) |
Definition at line 718 of file Searcher.cpp.
References clear(), m_Mode, MODE_PAUSE, MODE_RUN, and updateWinList().
bool Searcher::step | ( | float | dt | ) |
Definition at line 288 of file Searcher.cpp.
References m_EMap, m_Mode, m_Population, m_Time, MODE_DONE, and MODE_PAUSE.
Referenced by Brain::evolve(), and MStructure::stepSearch().
bool Searcher::triggerTest | ( | int | mx, |
int | my, | ||
int | what | ||
) |
Definition at line 728 of file Searcher.cpp.
References clear(), Model::getName(), getQualityRange(), SearcherParams::global, m_EMap, EMDistribution::m_Integral, m_Mode, m_Population, m_Representative, m_Time, MODE_DONE, MODE_PAUSE, MODE_RUN, and updateWinList().
Referenced by getExpectationMap(), and Brain::triggerTest().
Definition at line 675 of file Searcher.cpp.
References m_Population, and m_Winners.
Referenced by getShapeWeight(), operator=(), startSearch(), and triggerTest().
|
protected |
Definition at line 66 of file Searcher.h.
Referenced by buildBins(), cleanFlags(), distribute(), and operator=().
|
protected |
Definition at line 73 of file Searcher.h.
Referenced by buildBins(), buildClusters(), and operator=().
|
protected |
Definition at line 71 of file Searcher.h.
Referenced by buildBins(), buildClusters(), clear(), and operator=().
|
protected |
Definition at line 72 of file Searcher.h.
Referenced by buildBins(), buildClusters(), clear(), getBindex(), and operator=().
|
protected |
Definition at line 72 of file Searcher.h.
Referenced by buildBins(), clear(), getBindex(), and operator=().
|
protected |
Definition at line 74 of file Searcher.h.
Referenced by buildClusters(), and selectWinners().
|
protected |
Definition at line 76 of file Searcher.h.
Referenced by buildClusters().
|
protected |
Definition at line 68 of file Searcher.h.
Referenced by buildBins(), clear(), distribute(), evolve(), getExpectationMap(), operator bool(), operator=(), reattachSensors(), setExpectationMap(), step(), and triggerTest().
|
protected |
Definition at line 81 of file Searcher.h.
Referenced by clear(), operator=(), and Searcher().
|
protected |
Definition at line 67 of file Searcher.h.
Referenced by buildBins(), and cleanFlags().
|
protected |
Definition at line 67 of file Searcher.h.
Referenced by buildBins(), and cleanFlags().
|
protected |
Definition at line 80 of file Searcher.h.
Referenced by evolve(), operator=(), searchDone(), startSearch(), step(), and triggerTest().
|
protected |
Definition at line 82 of file Searcher.h.
Referenced by evolve(), operator=(), SearcherParams::read(), Searcher(), SearcherParams::SearcherParams(), and SearcherParams::write().
|
protected |
Definition at line 75 of file Searcher.h.
Referenced by buildClusters(), SearcherParams::read(), SearcherParams::SearcherParams(), and SearcherParams::write().
|
protected |
Definition at line 84 of file Searcher.h.
Referenced by evolve(), and operator=().
|
protected |
Definition at line 70 of file Searcher.h.
Referenced by add(), clear(), evolve(), operator=(), and remove().
|
protected |
Definition at line 69 of file Searcher.h.
Referenced by add(), buildBins(), buildClusters(), cleanFlags(), clear(), draw(), evolve(), getBestQOF(), getLeastQOF(), getQualityRange(), getWinners(), operator=(), reattachSensors(), remove(), step(), triggerTest(), and updateWinList().
|
protected |
Definition at line 78 of file Searcher.h.
Referenced by operator=(), and setExpectationMap().
|
protected |
Definition at line 78 of file Searcher.h.
Referenced by operator=(), and setExpectationMap().
|
protected |
Definition at line 78 of file Searcher.h.
Referenced by buildBins(), operator=(), and setExpectationMap().
|
protected |
Definition at line 65 of file Searcher.h.
Referenced by buildBins(), buildClusters(), cleanFlags(), clear(), distribute(), draw(), evolve(), getRepresentative(), operator=(), reattachSensors(), and triggerTest().
|
protected |
Definition at line 85 of file Searcher.h.
Referenced by buildBins(), getShapeWeight(), operator=(), SearcherParams::read(), Searcher(), SearcherParams::SearcherParams(), setShapeWeight(), and SearcherParams::write().
|
protected |
Definition at line 66 of file Searcher.h.
Referenced by buildBins(), cleanFlags(), distribute(), and operator=().
|
protected |
Definition at line 77 of file Searcher.h.
Referenced by add(), cleanFlags(), clear(), evolve(), getGeneration(), operator=(), selectWinners(), step(), and triggerTest().
Definition at line 83 of file Searcher.h.
Referenced by clear(), draw(), evolve(), getWinList(), getWinner(), operator=(), and updateWinList().
enum { ... } Searcher::SMode |