4 template <
typename TaskType,
typename PlanType>
6 std::function<PlanType*(TaskType* _task)>;
8 template <
typename PlanType>
10 std::function<double(PlanType* _plan)>;
12 template <
typename SolutionType,
typename PlanType>
14 std::function<SolutionType*(PlanType* _plan)>;
16 template <
typename SolutionType>
18 std::function<double(SolutionType* _solution)>;
21 template <
typename TaskType,
typename SolutionType,
typename PlanType>
25 SolutionType* _solution,
33 double lowerBound = 0;
37 auto relaxedPlan = _relaxedPlanner(_task);
38 lowerBound = _relaxedCost(relaxedPlan);
40 if (upperBound < lowerBound)
43 auto solution = _constrainedPlanner(relaxedPlan);
44 double solutionCost = _constrainedCost(solution);
46 if(solutionCost < upperBound) {
48 upperBound = solutionCost;
#define MAX_DBL
Definition: MPUtils.h:33
std::function< SolutionType *(PlanType *_plan)> ConstrainedPlanFunction
Definition: NBS.h:14
std::function< double(SolutionType *_solution)> ConstrainedCostFunction
Definition: NBS.h:18
void NBS(TaskType *_task, SolutionType *_solution, RelaxedPlanFunction< TaskType, PlanType > &_relaxedPlanner, RelaxedCostFunction< PlanType > &_relaxedCost, ConstrainedPlanFunction< SolutionType, PlanType > &_constrainedPlanner, ConstrainedCostFunction< SolutionType > &_constrainedCost)
Definition: NBS.h:23
std::function< PlanType *(TaskType *_task)> RelaxedPlanFunction
Definition: NBS.h:6
std::function< double(PlanType *_plan)> RelaxedCostFunction
Definition: NBS.h:10