标签:eve tis tin over http situation width oal single
n most situations, a single cost function will not be sufficient to produce complex vehicle behavior. In this quiz, we‘d like you to implement one more cost function in C++. We will use these two C++ cost functions later in the lesson. The goal with this quiz is to create a cost function that would make the vehicle drive in the fastest possible lane, given several behavior options. We will provide the following four inputs to the function:
Your task in the implementation will be to create a cost function that satisifes:
You can implement your solution in cost.cpp
below.
cost.cpp
float inefficiency_cost (int target_speed, int intended_lane,int final_lane, vector<int> lane_speeds) { float speed_intended=lane_speeds[intended_lane]; float speed_final=lane_speeds[final_lane]; float cost=(2.0*target_speed-speed_intended-speed_final)/target_speed; return cost; }
behavior planning——14.implement a cost function in C++
标签:eve tis tin over http situation width oal single
原文地址:https://www.cnblogs.com/fuhang/p/8984716.html