1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| #ifndef COST_H #define COST_H
#include "vehicle.h"
using std::map; using std::string; using std::vector;
float calculate_cost(const Vehicle &vehicle, //计算损失函数,const代表不可修改 const map<int, vector<Vehicle>> &predictions, const vector<Vehicle> &trajectory);
float goal_distance_cost(const Vehicle &vehicle, //目标距离损失 const vector<Vehicle> &trajectory, const map<int, vector<Vehicle>> &predictions, map<string, float> &data);
float inefficiency_cost(const Vehicle &vehicle, //无效率成本 const vector<Vehicle> &trajectory, const map<int, vector<Vehicle>> &predictions, map<string, float> &data);
float lane_speed(const map<int, vector<Vehicle>> &predictions, int lane);//道路速度
map<string, float> get_helper_data(const Vehicle &vehicle, //获取帮助数据 const vector<Vehicle> &trajectory, const map<int, vector<Vehicle>> &predictions);
#endif // COST_H
|