|
@@ -927,21 +927,22 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
|
|
|
try {
|
|
|
|
|
|
-
|
|
|
+
|
|
|
List<Double> time_list = new ArrayList<>();
|
|
|
-
|
|
|
+
|
|
|
List<Double> velocity_list = new ArrayList<>();
|
|
|
List<Double> lateral_velocity_list = new ArrayList<>();
|
|
|
List<Double> longitudinal_velocity_list = new ArrayList<>();
|
|
|
-
|
|
|
- List<Double> acceleration_list = new ArrayList<>();
|
|
|
- List<Double> lateral_acceleration = new ArrayList<>();
|
|
|
- List<Double> longitudinal_acceleration_list = new ArrayList<>();
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ List<Double> lateral_acceleration_list = new ArrayList<>();
|
|
|
+ List<Double> longitudinal_acceleration_list = new ArrayList<>();
|
|
|
+
|
|
|
List<Double> lane_offset_list = new ArrayList<>();
|
|
|
|
|
|
List<Double> brake_list = new ArrayList<>();
|
|
|
-
|
|
|
+
|
|
|
List<Double> steeting_wheel_list = new ArrayList<>();
|
|
|
|
|
|
List<Double> throttle_list = new ArrayList<>();
|
|
@@ -978,6 +979,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
String[] split = line.split(",");
|
|
|
|
|
|
|
|
|
+
|
|
|
try {
|
|
|
double aDouble = Double.parseDouble(split[1]);
|
|
|
if (Double.isNaN(aDouble)) {
|
|
@@ -989,7 +991,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
time_list.add(0D);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
try {
|
|
|
double aDouble = Double.parseDouble(split[6]);
|
|
|
if (Double.isNaN(aDouble)) {
|
|
@@ -997,11 +999,11 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
} else {
|
|
|
lateral_velocity_list.add(Double.valueOf(split[6]));
|
|
|
}
|
|
|
-
|
|
|
} catch (NumberFormatException e) {
|
|
|
lateral_velocity_list.add(0D);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
try {
|
|
|
double aDouble = Double.parseDouble(split[7]);
|
|
|
if (Double.isNaN(aDouble)) {
|
|
@@ -1014,17 +1016,19 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
}
|
|
|
|
|
|
|
|
|
+
|
|
|
try {
|
|
|
double aDouble = Double.parseDouble(split[8]);
|
|
|
if (Double.isNaN(aDouble)) {
|
|
|
- lateral_acceleration.add(0D);
|
|
|
+ lateral_acceleration_list.add(0D);
|
|
|
} else {
|
|
|
- lateral_acceleration.add(Double.valueOf(split[8]));
|
|
|
+ lateral_acceleration_list.add(Double.valueOf(split[8]));
|
|
|
}
|
|
|
} catch (NumberFormatException e) {
|
|
|
- lateral_acceleration.add(0D);
|
|
|
+ lateral_acceleration_list.add(0D);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
try {
|
|
|
double aDouble = Double.parseDouble(split[9]);
|
|
|
if (Double.isNaN(aDouble)) {
|
|
@@ -1036,6 +1040,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
longitudinal_acceleration_list.add(0D);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
try {
|
|
|
double aDouble = Double.parseDouble(split[12]);
|
|
|
if (Double.isNaN(aDouble)) {
|
|
@@ -1059,8 +1064,8 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
- Double aDouble = Double.valueOf(split[27]);
|
|
|
- if (aDouble.isNaN()) {
|
|
|
+ double aDouble = Double.parseDouble(split[27]);
|
|
|
+ if (Double.isNaN(aDouble)) {
|
|
|
lane_offset_list.add(0D);
|
|
|
} else {
|
|
|
lane_offset_list.add(Double.valueOf(split[27]));
|
|
@@ -1073,7 +1078,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
|
|
|
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
double lc = 0.0;
|
|
|
for (int i = 0; i < time_list.size(); i++) {
|
|
|
if (i == 0) {
|
|
@@ -1083,26 +1088,19 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+
|
|
|
Double pjsd = lc / time_list.get(time_list.size() - 1);
|
|
|
pjsd = saveTwoDecimalPlaces(pjsd, 4);
|
|
|
|
|
|
-
|
|
|
- Double zdsd = Collections.max(longitudinal_velocity_list);
|
|
|
-
|
|
|
-
|
|
|
- Double zxsd = Collections.min(longitudinal_velocity_list);
|
|
|
-
|
|
|
-
|
|
|
- Double zdjiasd = Collections.max(longitudinal_acceleration_list);
|
|
|
+ Double zdsd = Collections.max(longitudinal_velocity_list);
|
|
|
+ Double zxsd = Collections.min(longitudinal_velocity_list);
|
|
|
+ Double maxLateralAcceleration = Collections.max(lateral_acceleration_list);
|
|
|
+ Double minLateralAcceleration = Collections.min(lateral_acceleration_list);
|
|
|
+ Double maxLongitudinalAcceleration = Collections.max(longitudinal_acceleration_list);
|
|
|
+ Double minLongitudinalAcceleration = Collections.min(longitudinal_acceleration_list);
|
|
|
+ Double zdbjsd = Collections.max(yawrate_list);
|
|
|
|
|
|
-
|
|
|
- Double zdjiansd = Collections.min(longitudinal_acceleration_list);
|
|
|
-
|
|
|
-
|
|
|
- Double zdbjsd = Collections.max(yawrate_list);
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
Double zcsdfc = 0D;
|
|
|
for (Double d : longitudinal_velocity_list) {
|
|
|
zcsdfc += Math.pow(d - pjsd, 2);
|
|
@@ -1119,12 +1117,12 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
zchbjsdjfg = Math.sqrt(zchbjsdjfg / yawrate_list.size());
|
|
|
zchbjsdjfg = saveTwoDecimalPlaces(zchbjsdjfg, 4);
|
|
|
|
|
|
- for (int i = 0; i < lateral_acceleration.size(); i++) {
|
|
|
- Double aDouble = lateral_acceleration.get(i);
|
|
|
- Double aDouble1 = longitudinal_acceleration_list.get(i);
|
|
|
- double d = Math.pow(aDouble, 2) + Math.pow(aDouble1, 2);
|
|
|
- acceleration_list.add(Math.sqrt(d));
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
for (int i = 0; i < lateral_velocity_list.size(); i++) {
|
|
|
Double aDouble = lateral_velocity_list.get(i);
|
|
@@ -1154,10 +1152,12 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
|
|
|
resultVo.setMileage(Double.toString(lc));
|
|
|
resultVo.setAverageVelocity(saveTwoDecimalPlaces(pjsd * 3.6, 4).toString());
|
|
|
- resultVo.setMaximunSpeed(zdsd.toString());
|
|
|
- resultVo.setMinimunVelocity(zxsd.toString());
|
|
|
- resultVo.setMaximumAcceleration(zdjiasd.toString());
|
|
|
- resultVo.setMaximumDeceleration(zdjiansd.toString());
|
|
|
+ resultVo.setMaximunSpeed(zdsd.toString());
|
|
|
+ resultVo.setMinimunVelocity(zxsd.toString());
|
|
|
+ resultVo.setMaximumAcceleration(maxLateralAcceleration.toString());
|
|
|
+ resultVo.setMaximumDeceleration(minLateralAcceleration.toString());
|
|
|
+ resultVo.setMaxLongitudinalAcceleration(maxLongitudinalAcceleration.toString());
|
|
|
+ resultVo.setMinLongitudinalAcceleration(minLongitudinalAcceleration.toString());
|
|
|
resultVo.setMaximumSwingSpeed(zdbjsd.toString());
|
|
|
resultVo.setSpeedVariance(zcsdfc);
|
|
|
|
|
@@ -1168,7 +1168,8 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
|
|
|
HashMap<String, List> CurveData = new HashMap<>();
|
|
|
CurveData.put("time", time_list);
|
|
|
- CurveData.put("acceleration", acceleration_list);
|
|
|
+ CurveData.put("acceleration", lateral_acceleration_list);
|
|
|
+ CurveData.put("acceleration_longitudinal", longitudinal_acceleration_list);
|
|
|
CurveData.put("lane_offset", lane_offset_list);
|
|
|
CurveData.put("brake", brake_list);
|
|
|
CurveData.put("steeting", steeting_wheel_list);
|