Provides an interface for selecting an optmial algorithm. More...
#include <AlgorithmSelector.h>
Public Member Functions | |
int | AddAlgorithm (Algorithm< T > *alg, int nType, double dEval, double dTime) |
AlgorithmSelector () | |
AlgorithmSelector (XMLTag *node) | |
virtual Algorithm< T > * | BestAlgorithm (int type, const Signature &sig, const std::vector< Sensor * > &sensors) |
Selects from a list the best algorithm. | |
std::vector< Algorithm< T > * > | BestAlgorithmList (int type, const Signature &sig, const std::vector< Sensor * > &sensors) |
Selects all algorithm which are applicable. | |
int | CountAlgorithms () |
virtual void | EvalAlgorithm (Evaluable *alg, double eval, double time, Signature *relatedElemg) |
const std::vector < AlgorithmEval< T > > & | GetAlgorithmList () const |
void | ReevaluatePose (Algorithm< T > *alg, RelPose *&pose) |
XMLTag * | Save (std::string name="") |
~AlgorithmSelector () | |
Protected Member Functions | |
bool | CheckTypeCompatibility (int listedType, int askedType) |
Algorithm< T > * | getAlgorithm (int index) |
std::vector< AlgorithmEval< T > > & | GetAlgorithmList (std::vector< AlgorithmEval< T > > *eval=NULL) |
int | InsertInList (AlgorithmEval< T > eval) |
double | ReEvalKernel (double val) |
Private Types | |
typedef boost::mutex::scoped_lock | lock |
Private Attributes | |
std::vector< AlgorithmEval< T > > | m_algorithmlist |
boost::mutex * | m_mutexAlgEval |
int | m_paAllocatedLength |
int | m_paDim |
int | m_paLength |
ANNpointArray | m_pointArray |
double * | m_pointEval |
ANNkd_tree * | m_tree |
Provides an interface for selecting an optmial algorithm.
class AlgorithmSelector
Definition at line 62 of file AlgorithmSelector.h.
typedef boost::mutex::scoped_lock cop::AlgorithmSelector< T >::lock [private] |
Definition at line 190 of file AlgorithmSelector.h.
cop::AlgorithmSelector< T >::AlgorithmSelector | ( | ) | [inline] |
Constructor
Definition at line 70 of file AlgorithmSelector.h.
AlgorithmSelector::AlgorithmSelector | ( | XMLTag * | node | ) |
Definition at line 6 of file AlgorithmSelector.hpp.
cop::AlgorithmSelector< T >::~AlgorithmSelector | ( | ) | [inline] |
Empty Destructor
Definition at line 93 of file AlgorithmSelector.h.
int AlgorithmSelector::AddAlgorithm | ( | Algorithm< T > * | alg, |
int | nType, | ||
double | dEval, | ||
double | dTime | ||
) |
AddAlgorithm
alg | A pointer to a algorithm class |
nType | the algorithm type (e.g. ) |
dEval |
Definition at line 321 of file AlgorithmSelector.hpp.
Algorithm< T > * AlgorithmSelector::BestAlgorithm | ( | int | type, |
const Signature & | sig, | ||
const std::vector< Sensor * > & | sensors | ||
) | [virtual] |
Selects from a list the best algorithm.
BestAlgorithm
type | specifies the type of algorithm that should be searched, normally a multiple of 0x100 modulo a special case |
sig | specifies the signature that has to be searched |
sensors | the list of available sensors seeing the target region |
Definition at line 73 of file AlgorithmSelector.hpp.
std::vector< Algorithm< T > * > AlgorithmSelector::BestAlgorithmList | ( | int | type, |
const Signature & | sig, | ||
const std::vector< Sensor * > & | sensors | ||
) |
Selects all algorithm which are applicable.
BestAlgorithmList
type | specifies the type of algorithm that should be searched, normally a multiple of 0x100 modulo a special case |
sig | specifies the signature that has to be searched |
sensors | the list of available sensors seeing the target region |
Definition at line 120 of file AlgorithmSelector.hpp.
bool AlgorithmSelector::CheckTypeCompatibility | ( | int | listedType, |
int | askedType | ||
) | [protected] |
test compatibility of an algorithm with a task
Definition at line 308 of file AlgorithmSelector.hpp.
int cop::AlgorithmSelector< T >::CountAlgorithms | ( | ) | [inline] |
Return num of Algorithms in the visual finder
Definition at line 132 of file AlgorithmSelector.h.
void AlgorithmSelector::EvalAlgorithm | ( | Evaluable * | alg, |
double | eval, | ||
double | time, | ||
Signature * | relatedElemg | ||
) | [virtual] |
Replace the evaluatro interface function
TODO add position to ANN search tree, recalculate search tree
Implements cop::Evaluator.
Definition at line 170 of file AlgorithmSelector.hpp.
Algorithm< T > * AlgorithmSelector::getAlgorithm | ( | int | index | ) | [protected] |
Get the value of m_algorithmlist
Definition at line 66 of file AlgorithmSelector.hpp.
const std::vector<AlgorithmEval<T> >& cop::AlgorithmSelector< T >::GetAlgorithmList | ( | ) | const [inline] |
Get the algorithm list
Definition at line 136 of file AlgorithmSelector.h.
std::vector<AlgorithmEval<T> >& cop::AlgorithmSelector< T >::GetAlgorithmList | ( | std::vector< AlgorithmEval< T > > * | eval = NULL | ) | [protected] |
Get the algorithm list
int AlgorithmSelector::InsertInList | ( | AlgorithmEval< T > | eval | ) | [protected] |
Insets in the list of a special type of algorithms
Definition at line 52 of file AlgorithmSelector.hpp.
double AlgorithmSelector::ReEvalKernel | ( | double | val | ) | [protected] |
Helper for ReevaluatePose
Definition at line 259 of file AlgorithmSelector.hpp.
void AlgorithmSelector::ReevaluatePose | ( | Algorithm< T > * | alg, |
RelPose *& | pose | ||
) |
Aposteriori evaulation of poses, if there were previous results with this algorithm at a similar position, to judge the reliability
Definition at line 265 of file AlgorithmSelector.hpp.
XMLTag * AlgorithmSelector::Save | ( | std::string | name = "" | ) |
Save
name | sets the name of the node returned |
Definition at line 46 of file AlgorithmSelector.hpp.
std::vector<AlgorithmEval<T> > cop::AlgorithmSelector< T >::m_algorithmlist [private] |
List of Algorithms, including their evaluation
Definition at line 178 of file AlgorithmSelector.h.
boost::mutex* cop::AlgorithmSelector< T >::m_mutexAlgEval [private] |
Definition at line 191 of file AlgorithmSelector.h.
int cop::AlgorithmSelector< T >::m_paAllocatedLength [private] |
Definition at line 187 of file AlgorithmSelector.h.
int cop::AlgorithmSelector< T >::m_paDim [private] |
Definition at line 188 of file AlgorithmSelector.h.
int cop::AlgorithmSelector< T >::m_paLength [private] |
Definition at line 186 of file AlgorithmSelector.h.
ANNpointArray cop::AlgorithmSelector< T >::m_pointArray [private] |
Definition at line 184 of file AlgorithmSelector.h.
double* cop::AlgorithmSelector< T >::m_pointEval [private] |
Definition at line 185 of file AlgorithmSelector.h.
ANNkd_tree* cop::AlgorithmSelector< T >::m_tree [private] |
Definition at line 183 of file AlgorithmSelector.h.