37 #include "ompl/base/objectives/MinimaxObjective.h"
39 ompl::base::MinimaxObjective::MinimaxObjective(
const SpaceInformationPtr &si) :
40 OptimizationObjective(si)
46 Cost worstCost = this->identityCost();
48 int nd = si_->getStateSpace()->validSegmentCount(s1, s2);
52 State *test = si_->allocState();
53 for (
int j = 1; j < nd; ++j)
55 si_->getStateSpace()->interpolate(s1, s2, (
double) j / (
double) nd, test);
56 Cost testStateCost = this->stateCost(test);
57 if (this->isCostBetterThan(worstCost, testStateCost))
58 worstCost = testStateCost;
64 Cost lastCost = this->stateCost(s2);
65 if (this->isCostBetterThan(worstCost, lastCost))
73 if (this->isCostBetterThan(c1, c2))
virtual Cost combineCosts(Cost c1, Cost c2) const
Since we're only concerned about the "worst" state cost in the path, combining two costs just returns...
virtual Cost motionCost(const State *s1, const State *s2) const
Interpolates between s1 and s2 to check for state costs along the motion between the two states...
Definition of a cost value. Can represent the cost of a motion or the cost of a state.
Definition of an abstract state.