The AutoParameterExplorer tries to find a given target values for an given parameter (doubles) range. For this you have to: More...
#include <AutoParameterExplorer.h>
Classes | |
class | Area |
class | ParameterPoint |
class | Vector |
A n dimensional vector that can be added or generated out of ParameterPoint's. More... | |
Public Member Functions | |
void | AddParameter (const std::string &name, double min, double max) |
Adds a parameter range that can be searched for the desired result values. | |
AutoParameterExplorer (boost::function< void(const std::vector< double > &, std::map< std::string, double > &)> paramsFunction, boost::function< double(const std::map< std::string, double > &, const std::map< std::string, double > &)> costFunction) | |
Constructs a AutoParameterExplorer. | |
void | FindBest (std::map< std::string, double > targetValue, int steps, int numResults, std::vector< std::map< std::string, double > > &results) |
Starts searching for the best result. Before this is executed all parameters must be added. | |
virtual | ~AutoParameterExplorer () |
Deconstructor. | |
Private Member Functions | |
void | M_GetCosts (std::map< std::string, double > &targetValue, ParameterPoint ¶mPoint) |
void | M_GetCosts (std::map< std::string, double > &targetValue, Area &area) |
bool | M_IsTargetValueInside (std::map< std::string, double > &targetValue, Area &area) |
void | M_PushAllPoints (Area &area, std::map< std::string, double > &targetValues, face_contour_detector::LimitedPriorityQueueSet< ParameterPoint, ParameterPoint::LessCosts > &results) |
Private Attributes | |
boost::function< double(const std::map< std::string, double > &, const std::map < std::string, double > &)> | m_costsFunction |
std::vector< std::string > | m_paramNames |
boost::function< void(const std::vector< double > &, std::map< std::string, double > &)> | m_paramsFunction |
std::vector< std::pair< double, double > > | m_startEnd |
The AutoParameterExplorer tries to find a given target values for an given parameter (doubles) range. For this you have to:
Definition at line 29 of file AutoParameterExplorer.h.
face_contour_detector::AutoParameterExplorer::AutoParameterExplorer | ( | boost::function< void(const std::vector< double > &, std::map< std::string, double > &)> | paramsFunction, |
boost::function< double(const std::map< std::string, double > &, const std::map< std::string, double > &)> | costFunction | ||
) |
Constructs a AutoParameterExplorer.
paramsFunction | |
costFunction |
Definition at line 11 of file AutoParameterExplorer.cpp.
Deconstructor.
Definition at line 12 of file AutoParameterExplorer.cpp.
void face_contour_detector::AutoParameterExplorer::AddParameter | ( | const std::string & | name, |
double | min, | ||
double | max | ||
) |
Adds a parameter range that can be searched for the desired result values.
name | the name of the parameter (will be used in FindBest) |
min | the minimum value that can be chosen for the parameter |
max | the maximum value that can be chosen for the parameter |
Definition at line 14 of file AutoParameterExplorer.cpp.
void face_contour_detector::AutoParameterExplorer::FindBest | ( | std::map< std::string, double > | targetValue, |
int | steps, | ||
int | numResults, | ||
std::vector< std::map< std::string, double > > & | results | ||
) |
Starts searching for the best result. Before this is executed all parameters must be added.
targetValue | the target value that should be reached as close as possible |
steps | the maximum number of steps beeing taken before it stops drilling down |
numResults | how many results should be returned (if this is 1, only the best one will be retuned) |
results | all the resulting parameter combinations will be saved to this vector (the key for the map is the parameter name you set in AddParameter previously) |
TAG DEBUG
Definition at line 21 of file AutoParameterExplorer.cpp.
void face_contour_detector::AutoParameterExplorer::M_GetCosts | ( | std::map< std::string, double > & | targetValue, |
ParameterPoint & | paramPoint | ||
) | [private] |
Definition at line 132 of file AutoParameterExplorer.cpp.
void face_contour_detector::AutoParameterExplorer::M_GetCosts | ( | std::map< std::string, double > & | targetValue, |
Area & | area | ||
) | [private] |
use the middle of the area to evaluate it
Definition at line 158 of file AutoParameterExplorer.cpp.
bool face_contour_detector::AutoParameterExplorer::M_IsTargetValueInside | ( | std::map< std::string, double > & | targetValue, |
Area & | area | ||
) | [private] |
Definition at line 182 of file AutoParameterExplorer.cpp.
void face_contour_detector::AutoParameterExplorer::M_PushAllPoints | ( | Area & | area, |
std::map< std::string, double > & | targetValues, | ||
face_contour_detector::LimitedPriorityQueueSet< ParameterPoint, ParameterPoint::LessCosts > & | results | ||
) | [private] |
Definition at line 233 of file AutoParameterExplorer.cpp.
boost::function<double (const std::map<std::string, double>&, const std::map<std::string, double>&)> face_contour_detector::AutoParameterExplorer::m_costsFunction [private] |
Definition at line 113 of file AutoParameterExplorer.h.
std::vector<std::string> face_contour_detector::AutoParameterExplorer::m_paramNames [private] |
Definition at line 110 of file AutoParameterExplorer.h.
boost::function<void (const std::vector<double>&, std::map<std::string, double>&)> face_contour_detector::AutoParameterExplorer::m_paramsFunction [private] |
Definition at line 112 of file AutoParameterExplorer.h.
std::vector<std::pair<double,double> > face_contour_detector::AutoParameterExplorer::m_startEnd [private] |
Definition at line 111 of file AutoParameterExplorer.h.