23 unsigned int minFalseNegatives,
unsigned int maxFalseNegatives,
24 double minAverageRecognitionRuntime,
double maxAverageRecognitionRuntime,
25 double alpha,
double beta,
double gamma)
26 : mMinFalsePositives(minFalsePositives)
27 , mMaxFalsePositives(maxFalsePositives)
28 , mMinFalseNegatives(minFalseNegatives)
29 , mMaxFalseNegatives(maxFalseNegatives)
30 , mMinAverageRecognitionRuntime(minAverageRecognitionRuntime)
31 , mMaxAverageRecognitionRuntime(maxAverageRecognitionRuntime)
43 std::string fromEarlier =
"";
44 if (instance->isCostValid()) fromEarlier =
" (from earlier)";
52 if (normalisedFalsePositives < 0 || normalisedFalseNegatives < 0 || normalisedAverageRecognitionRuntime < 0)
54 cost = std::numeric_limits<double>::infinity();
58 cost =
mAlpha * normalisedFalsePositives +
mBeta * normalisedAverageRecognitionRuntime +
mGamma * normalisedFalseNegatives;
61 instance->setCost(cost);
63 ROS_INFO_STREAM(
"Cost of topology " << instance->mIdentifier <<
" is " << instance->getCost() << fromEarlier);
65 return instance->getCost();
WeightedSum(unsigned int minFalsePositives, unsigned int maxFalsePositives, unsigned int minFalseNegatives, unsigned int maxFalseNegatives, double minAverageRecognitionRuntime, double maxAverageRecognitionRuntime, double alpha, double beta, double gamma)
unsigned int mMinFalsePositives
double getNormalisedFalseNegatives(unsigned int falseNegatives)
unsigned int mMaxFalseNegatives
double mMinAverageRecognitionRuntime
double getNormalisedFalsePositives(unsigned int falsePositives)
double mMaxAverageRecognitionRuntime
double getNormalisedAverageRecognitionRuntime(double averageRecognitionRuntime)
unsigned int mMinFalseNegatives
double calculateCost(boost::shared_ptr< SceneModel::Topology > instance)
#define ROS_INFO_STREAM(args)
unsigned int mMaxFalsePositives