Example of a simple search abort class: abort when time has expired. More...
#include <SgSearchControl.h>
Public Member Functions | |
SgTimeSearchControl (double maxTime) | |
virtual | ~SgTimeSearchControl () |
virtual bool | Abort (double elapsedTime, int ignoreNumNodes) |
Check if search should be aborted. | |
double | GetMaxTime () const |
void | SetMaxTime (double maxTime) |
virtual bool | StartNextIteration (int depth, double elapsedTime, int numNodes) |
Check if next iteration should be started. | |
Private Member Functions | |
SgTimeSearchControl (const SgTimeSearchControl &) | |
Not implemented. | |
SgTimeSearchControl & | operator= (const SgTimeSearchControl &) |
Not implemented. | |
Private Attributes | |
double | m_maxTime |
Example of a simple search abort class: abort when time has expired.
Definition at line 51 of file SgSearchControl.h.
SgTimeSearchControl::SgTimeSearchControl | ( | double | maxTime | ) |
Definition at line 26 of file SgSearchControl.cpp.
SgTimeSearchControl::~SgTimeSearchControl | ( | ) | [virtual] |
Definition at line 31 of file SgSearchControl.cpp.
SgTimeSearchControl::SgTimeSearchControl | ( | const SgTimeSearchControl & | ) | [private] |
Not implemented.
bool SgTimeSearchControl::Abort | ( | double | elapsedTime, | |
int | numNodes | |||
) | [virtual] |
Check if search should be aborted.
Called at each node.
Implements SgSearchControl.
Definition at line 35 of file SgSearchControl.cpp.
References m_maxTime, and SG_UNUSED().
double SgTimeSearchControl::GetMaxTime | ( | ) | const |
Definition at line 75 of file SgSearchControl.h.
References m_maxTime.
SgTimeSearchControl& SgTimeSearchControl::operator= | ( | const SgTimeSearchControl & | ) | [private] |
Not implemented.
void SgTimeSearchControl::SetMaxTime | ( | double | maxTime | ) |
Definition at line 80 of file SgSearchControl.h.
References m_maxTime.
bool SgSearchControl::StartNextIteration | ( | int | depth, | |
double | elapsedTime, | |||
int | numNodes | |||
) | [virtual, inherited] |
Check if next iteration should be started.
Called before each iteration. The default implementation always returns true.
depth | The depth of the next iteration. | |
elapsedTime | The elapsed time in seconds. | |
numNodes | The number of nodes visited. |
Definition at line 15 of file SgSearchControl.cpp.
References SG_UNUSED().
Referenced by SgSearch::IteratedSearch().
double SgTimeSearchControl::m_maxTime [private] |
Definition at line 66 of file SgSearchControl.h.
Referenced by Abort(), GetMaxTime(), and SetMaxTime().