|
@@ -404,6 +404,11 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
//算法配置
|
|
|
AlgorithmPO algorithmBaseInfoVo = getAlgorithmInfo(poParam);
|
|
|
|
|
|
+
|
|
|
+ //获取测试得分列表
|
|
|
+ List<AlgorithmScoreVo> firstTargetScore = getFirstTargetScore(param.getId());
|
|
|
+ projectDetailsVo.setAlgorithmScoreList(firstTargetScore);
|
|
|
+
|
|
|
//车辆配置
|
|
|
VehiclePO vehicleBaseInfoVo = null;
|
|
|
String vehicleConfigId = poParam.getVehicle();
|
|
@@ -469,15 +474,21 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
|
|
|
//任务运行状态统计
|
|
|
List<ProjectRunStateNumVo> projectRunStateNumVos = null;
|
|
|
+
|
|
|
+ //任务运行结果统计
|
|
|
+ List<ProjectRunResultRatioNumVo> resultScoreList = null;
|
|
|
+
|
|
|
Integer size = simulationProjectTaskMapper.selectProjectTaskNumByProjectId(projectTaskParam);
|
|
|
if(size > 0){
|
|
|
projectRunStateNumVos = simulationProjectTaskMapper.selectRunStateCount(poParam.getId());
|
|
|
taskRunState(projectRunStateNumVos, size);
|
|
|
|
|
|
-
|
|
|
projectRunResultRatioNumVos = simulationProjectTaskMapper.selectRunResultCount(poParam.getId());
|
|
|
taskResultState(projectRunResultRatioNumVos, size);
|
|
|
|
|
|
+ resultScoreList = simulationProjectTaskMapper.selectScoreCount(poParam.getId());
|
|
|
+ taskScore(resultScoreList,size);
|
|
|
+
|
|
|
}
|
|
|
|
|
|
projectDetailsVo.setProjectId(poParam.getProjectId());
|
|
@@ -506,6 +517,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
projectDetailsVo.setSensorGpsList(sensorGpsList);
|
|
|
projectDetailsVo.setStateList(projectRunStateNumVos);
|
|
|
projectDetailsVo.setResultList(projectRunResultRatioNumVos);
|
|
|
+ projectDetailsVo.setResultScoreList(resultScoreList);
|
|
|
|
|
|
projectDetailsVo.setParallelism(poParam.getParallelism());
|
|
|
projectDetailsVo.setMaxSimulationTime(poParam.getMaxSimulationTime());
|
|
@@ -596,6 +608,18 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 得分统计
|
|
|
+ */
|
|
|
+ private void taskScore(List<ProjectRunResultRatioNumVo> vos,Integer size){
|
|
|
+ for(ProjectRunResultRatioNumVo rv : vos){
|
|
|
+ Integer num = rv.getNum();
|
|
|
+ Double d = (double)num/size;
|
|
|
+ d = saveTwoDecimalPlaces(d);
|
|
|
+ rv.setRatio(d);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private void setVehicleConfig(SensorBaseInfoVo vo, ConfigSensorPO vs){
|
|
|
vo.setConfigId(vs.getConfigId());
|
|
|
vo.setSensorId(vs.getSensorId());
|
|
@@ -800,7 +824,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
|
|
|
//场景得分列表
|
|
|
// Map<String, Object> maps = selectSceneScore(pos, po.getId());
|
|
|
- Map<String, Object> maps = selectSceneScore(poParam.getScene(), poParam.getId());
|
|
|
+ Map<String, Object> maps = selectSceneScore(poParam.getScene(), poParam.getId(), null);
|
|
|
projectReportVo.setSceneScoreLiTitle((List<Map>) maps.get("cloums"));
|
|
|
projectReportVo.setSceneScoreLi((List<SceneScListVo>) maps.get("result"));
|
|
|
|
|
@@ -883,6 +907,40 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
resultVo.setFinishState(po.getRunResult());
|
|
|
resultVo.setSceneDescribe("");
|
|
|
|
|
|
+ /*
|
|
|
+ 获取任务得分详情
|
|
|
+ */
|
|
|
+
|
|
|
+
|
|
|
+ if(isEmpty(param.getProjectType())){
|
|
|
+ param.setProjectType("1");//默认
|
|
|
+ }
|
|
|
+
|
|
|
+ //获取项目基本信息
|
|
|
+ //封装要使用到的数据
|
|
|
+ SimulationManualProjectPo poParam = new SimulationManualProjectPo();
|
|
|
+
|
|
|
+ if("1".equals(param.getProjectType())){
|
|
|
+ //项目基本信息
|
|
|
+ SimulationManualProjectPo spo = simulationProjectMapper.selectProjectBaseById(param);
|
|
|
+ if(spo == null){
|
|
|
+ return new ResponseBodyVO(ResponseBodyVO.Response.SERVER_FAILURE, "没有获取到数据");
|
|
|
+ }
|
|
|
+ poParam = spo;
|
|
|
+ }else if("2".equals(param.getProjectType())){
|
|
|
+ SimulationManualProjectVo spo = simulationAutomaticSubProjectMapper.selectProjectInfo(param);
|
|
|
+ if(spo == null){
|
|
|
+ return new ResponseBodyVO(ResponseBodyVO.Response.SERVER_FAILURE, "没有获取到数据");
|
|
|
+ }
|
|
|
+
|
|
|
+ BeanUtils.copyProperties(po, poParam);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<String, Object> stringObjectMap = selectSceneScore(poParam.getScene(), poParam.getId(), taskId);
|
|
|
+ resultVo.setSceneScoreLiTitle((List<Map>) stringObjectMap.get("cloums"));
|
|
|
+ resultVo.setSceneScoreLi((List<SceneScListVo>) stringObjectMap.get("result"));
|
|
|
+
|
|
|
|
|
|
//1.获取仿真结果文件
|
|
|
InputStream fileInputStream = null;
|
|
@@ -1094,7 +1152,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
Double aDouble = lateral_velocity_list.get(i);
|
|
|
Double aDouble1 = longitudinal_velocity_list.get(i);
|
|
|
Double d = Math.pow(aDouble,2)+Math.pow(aDouble1,2);
|
|
|
- velocity_list.add(Math.sqrt(d));
|
|
|
+ velocity_list.add(Math.sqrt(d)*3.6);
|
|
|
}
|
|
|
|
|
|
//获取视频预览路径
|
|
@@ -1117,7 +1175,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
|
|
|
//任务详情信息
|
|
|
resultVo.setMileage(lc.toString());
|
|
|
- resultVo.setAverageVelocity(pjsd.toString());
|
|
|
+ resultVo.setAverageVelocity(saveTwoDecimalPlaces(pjsd*3.6, 4).toString());
|
|
|
resultVo.setMaximunSpeed(zdsd.toString());
|
|
|
resultVo.setMinimunVelocity(zxsd.toString());
|
|
|
resultVo.setMaximumAcceleration(zdjiasd.toString());
|
|
@@ -1138,7 +1196,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
CurveData.put("steeting",steeting_wheel_list);
|
|
|
CurveData.put("throttle",throttle_list);
|
|
|
CurveData.put("yaw_rate",yawrate_list);
|
|
|
- CurveData.put("velocity",velocity_list);
|
|
|
+ CurveData.put("velocity",velocity_list); //速度变化曲线
|
|
|
resultVo.setCurveData(CurveData);
|
|
|
|
|
|
|
|
@@ -1640,7 +1698,7 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
}
|
|
|
|
|
|
|
|
|
- private Map<String, Object> selectSceneScore(String scenePackageId, String projectId) {
|
|
|
+ private Map<String, Object> selectSceneScore(String scenePackageId, String projectId, String taskId) {
|
|
|
|
|
|
//查询场景包所有数据(包括得分信息)
|
|
|
SimulationManualProjectParam query = new SimulationManualProjectParam();
|
|
@@ -1654,6 +1712,9 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
//1.获取项目下所有场景得分
|
|
|
ProjectTaskParam param = new ProjectTaskParam();
|
|
|
param.setPId(projectId);
|
|
|
+ if(!isEmpty(taskId)){
|
|
|
+ param.setTaskId(taskId);
|
|
|
+ }
|
|
|
List<ManualProjectTaskVo> manualProjectTaskVos = simulationProjectTaskMapper.selectProjectTaskByProjectId(param);
|
|
|
|
|
|
List<SublistScoreVo> lastSubList = new ArrayList<>();
|
|
@@ -4231,4 +4292,75 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
throw new RuntimeException("自动运行项目停止失败:"+po.getId());
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取一级指标得分列表
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ private List<AlgorithmScoreVo> getFirstTargetScore(String id){
|
|
|
+ //算法测试得分表
|
|
|
+ /*
|
|
|
+ 汇总测试得分计算方法:(每一项一级指标的测试得分*测试权重)累加
|
|
|
+ 得分率计算方法:每一项一级指标的所有场景得分不为0的数量/每一项一级指标的场景数量
|
|
|
+ 汇总得分率计算方法:(每一项一级指标的所有场景得分不为0的数量_累加/每一项一级指标的场景数量_累加)换成(得分累加取平均值)
|
|
|
+ */
|
|
|
+ //获取得分表一级指标信息
|
|
|
+ SimulationMptFirstTargetScorePo par = new SimulationMptFirstTargetScorePo();
|
|
|
+ par.setPId(id);
|
|
|
+ List<SimulationMptFirstTargetScorePo> pos = simulationMptFirstTargetScoreMapper.selectFirstTargetByPid(par);
|
|
|
+
|
|
|
+ List<AlgorithmScoreVo> algorithmScoreVoList = new ArrayList();
|
|
|
+ String evaluationLevelReport = "";
|
|
|
+ if(!isEmpty(pos)){
|
|
|
+ StringBuffer stringBuffer = new StringBuffer("");
|
|
|
+
|
|
|
+ //汇总数据初始化
|
|
|
+ Integer totalSceneNum = 0;
|
|
|
+ Double totalScore = 0D;
|
|
|
+ Double totalScoreRatio=0D;
|
|
|
+ Integer totalSceneScoreNum = 0;
|
|
|
+
|
|
|
+ for(SimulationMptFirstTargetScorePo v : pos){
|
|
|
+
|
|
|
+
|
|
|
+ stringBuffer.append(v.getSublistName()+"、");
|
|
|
+ AlgorithmScoreVo algorithmScoreVo = new AlgorithmScoreVo();
|
|
|
+ algorithmScoreVo.setProjectName(v.getSublistName());
|
|
|
+ Integer sceneNum = v.getSceneNum();
|
|
|
+ totalSceneNum += sceneNum;
|
|
|
+ algorithmScoreVo.setSceneNum(sceneNum);
|
|
|
+ String weight = v.getWeight();
|
|
|
+ Double weightDouble = Double.valueOf(weight);
|
|
|
+ algorithmScoreVo.setWeight(weight);
|
|
|
+ //单个二级指标得分
|
|
|
+ Double score = v.getScore();
|
|
|
+ totalScore += BigDecimal.valueOf(score).multiply(BigDecimal.valueOf(weightDouble).divide(BigDecimal.valueOf(100))).doubleValue();
|
|
|
+ algorithmScoreVo.setScore(saveTwoDecimalPlaces(score));
|
|
|
+ //获取得分不为0的场景数量
|
|
|
+ Integer scoreNum = getSetScoreNum(v.getSublistId(),id);
|
|
|
+ totalSceneScoreNum += scoreNum;
|
|
|
+ algorithmScoreVo.setScoreRatio(saveTwoDecimalPlaces(Double.valueOf(scoreNum)/Double.valueOf(sceneNum)*100));
|
|
|
+ algorithmScoreVoList.add(algorithmScoreVo);
|
|
|
+
|
|
|
+ totalScoreRatio += Double.valueOf(scoreNum)/Double.valueOf(sceneNum)*100;
|
|
|
+ }
|
|
|
+ //汇总
|
|
|
+ AlgorithmScoreVo algorithmScoreVo = new AlgorithmScoreVo();
|
|
|
+ algorithmScoreVo.setProjectName("汇总");
|
|
|
+ algorithmScoreVo.setSceneNum(totalSceneNum);
|
|
|
+ //指标权重总和默认是100%
|
|
|
+ algorithmScoreVo.setWeight("100");
|
|
|
+ algorithmScoreVo.setScore(saveTwoDecimalPlaces(totalScore));
|
|
|
+
|
|
|
+ totalScoreRatio = Double.valueOf(totalSceneScoreNum)/Double.valueOf(totalSceneNum)*100;
|
|
|
+
|
|
|
+ algorithmScoreVo.setScoreRatio(saveTwoDecimalPlaces(totalScoreRatio));
|
|
|
+ algorithmScoreVoList.add(algorithmScoreVo);
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ return algorithmScoreVoList;
|
|
|
+
|
|
|
+ }
|
|
|
}
|