50 try{weight = std::stod(weight_string);}
catch(...){}
57 objectives_.push_back(std::make_pair(
"MinimumNavigationCostOnLane",1.0));
66 if(idx==-1)
return std::numeric_limits<double>::quiet_NaN();
87 for (
auto [
id, plan] : planning_results)
89 bool all_objectives_present =
true;
90 double weighted_sum = 0.0;
91 for(
auto [objective_name,objective_weight]:
objectives_)
93 if(objective_weight>0.0)
97 weighted_sum += objective_weight * plan.objective_values[objective_name];
101 all_objectives_present =
false;
102 std::cout<<
"plan "<<plan.name<<
" missing objective "<<objective_name<<
"."<<std::endl;
109 weighted_sum += 2001.0;
113 weighted_sum += 2001.0;
117 if( !all_objectives_present )
119 std::cout<<
"plan "<<plan.name<<
" missing objectives."<<std::endl;
122 if(!(weighted_sum>=0.0))
124 std::cout<<
"plan "<<plan.name<<
" weighted_sum not positive: "<<weighted_sum<<
"."<<std::endl;
129 std::cout<<
"plan "<<plan.name<<
" weighted_sum not smaller max_cost: "<<weighted_sum<<
">="<<
max_cost_<<
"."<<std::endl;
132 cost_list_.push_back(std::make_pair(
id,weighted_sum));
Definition: atrajectory_evaluator.h:32
Definition: evaluator_weighted_sum.h:31
double max_cost_
Definition: evaluator_weighted_sum.h:35
std::vector< std::pair< std::string, double > > objectives_
Definition: evaluator_weighted_sum.h:33
void init()
Definition: evaluator_weighted_sum.h:53
std::vector< std::pair< int, double > > cost_list_
Definition: evaluator_weighted_sum.h:34
int getIndex(int id)
Definition: evaluator_weighted_sum.h:72
Turnstate turnstate_
Definition: evaluator_weighted_sum.h:36
int evaluateToBest(const PlanningResultMap &planning_results) override
Definition: evaluator_weighted_sum.h:83
void setTurnState(Turnstate state)
Definition: evaluator_weighted_sum.h:43
void addParameterPair(std::string name, std::string weight_string)
Definition: evaluator_weighted_sum.h:47
EvaluatorWeightedSum()
Definition: evaluator_weighted_sum.h:41
double getCost(int id)
Definition: evaluator_weighted_sum.h:63
@ right
Definition: indicator_hint.h:36
@ left
Definition: indicator_hint.h:35
Turnstate
Definition: turnstate.h:21
std::unordered_map< int, adore::fun::PlanningResult > PlanningResultMap
Definition: atrajectory_evaluator.h:29
Definition: areaofeffectconverter.h:20