|
@@ -9,9 +9,7 @@ import api.common.pojo.param.KafkaParameter;
|
|
|
import api.common.pojo.param.MinioParameter;
|
|
|
import api.common.pojo.param.algorithm.AlgorithmParameter;
|
|
|
import api.common.pojo.param.project.*;
|
|
|
-import api.common.pojo.param.scene.SceneEvaluationForListParam;
|
|
|
-import api.common.pojo.param.scene.ScenePackageParam;
|
|
|
-import api.common.pojo.param.scene.SceneReferenceLibSelectParam;
|
|
|
+import api.common.pojo.param.scene.*;
|
|
|
import api.common.pojo.param.system.DictParam;
|
|
|
import api.common.pojo.po.algorithm.AlgorithmPO;
|
|
|
import api.common.pojo.po.group.SimulationMageGroupPO;
|
|
@@ -65,6 +63,7 @@ import java.math.RoundingMode;
|
|
|
import java.net.URLEncoder;
|
|
|
import java.nio.charset.StandardCharsets;
|
|
|
import java.nio.file.Files;
|
|
|
+import java.nio.file.Paths;
|
|
|
import java.text.DecimalFormat;
|
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
@@ -128,16 +127,25 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
private SceneEvaluationRuleMapper sceneEvaluationRuleMapper;
|
|
|
|
|
|
@Resource
|
|
|
- ScenePackageMapper scenePackageMapper;
|
|
|
+ private ScenePackageMapper scenePackageMapper;
|
|
|
|
|
|
@Resource
|
|
|
- SceneComplexityMapper sceneComplexityMapper;
|
|
|
+ private SceneComplexityMapper sceneComplexityMapper;
|
|
|
|
|
|
@Resource
|
|
|
- SceneRiskMapper sceneRiskMapper;
|
|
|
+ private SceneRiskMapper sceneRiskMapper;
|
|
|
|
|
|
@Resource
|
|
|
- SceneReferenceLibMapper sceneReferenceLibMapper;
|
|
|
+ private SceneReferenceLibMapper sceneReferenceLibMapper;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private SceneNaturalMapper sceneNaturalMapper;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private SceneStandardsRegulationsMapper sceneStandardsRegulationsMapper;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private SceneAccidentMapper sceneAccidentMapper;
|
|
|
|
|
|
// * -------------------------------- Comment --------------------------------
|
|
|
|
|
@@ -5184,22 +5192,30 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
|
|
|
int len;
|
|
|
byte[] buffer = new byte[1024];
|
|
|
- ZipOutputStream zos = null;
|
|
|
- File pdfFile = null;
|
|
|
+ ZipOutputStream zos;
|
|
|
try {
|
|
|
HttpServletResponse response = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getResponse();
|
|
|
response.setContentType("multipart/form-data");
|
|
|
response.setHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode("场景评价包.zip", "UTF-8"));
|
|
|
zos = new ZipOutputStream(response.getOutputStream());
|
|
|
// 下载所有任务的数据文件
|
|
|
- log.info("项目 {} 共有 {} 个任务。", id, manualProjectTaskVos.size());
|
|
|
- int i = 1;
|
|
|
List<String> naturalList = new ArrayList<>();
|
|
|
List<String> regulationlList = new ArrayList<>();
|
|
|
List<String> accidentList = new ArrayList<>();
|
|
|
List<String> referenceLibList = new ArrayList<>();
|
|
|
|
|
|
+
|
|
|
+ // 添加复杂度 危险度数据
|
|
|
+ List<String> sceneIdList = manualProjectTaskVos.stream().map(ManualProjectTaskVo::getSceneId).collect(Collectors.toList());
|
|
|
+ SceneEvaluationForListParam sceneEvaluationForListParam = new SceneEvaluationForListParam();
|
|
|
+ sceneEvaluationForListParam.setSceneIdList(sceneIdList);
|
|
|
+ sceneEvaluationForListParam.setTaskId(param.getId());
|
|
|
+ SceneEvaluationOperatePO sceneEvaluationOperatePO = sceneEvaluationRuleService.getSceneEvaluationFirst(sceneEvaluationForListParam);
|
|
|
+ Map<String, SceneComplexityPO> firstComplexityPOMap = sceneEvaluationOperatePO.getSceneComplexityPOMap();
|
|
|
+ Map<String, SceneRiskPO> firstRiskPOMap = sceneEvaluationOperatePO.getSceneRiskPOMap();
|
|
|
+ Map<String, Double> scoreMap = new HashMap<>();
|
|
|
for (ManualProjectTaskVo task : manualProjectTaskVos) {
|
|
|
+ scoreMap.put(task.getSceneId(), task.getScore());
|
|
|
// 先分类,后续用于查询具体字段内容
|
|
|
String sceneType = task.getSceneType();
|
|
|
String sceneId = task.getSceneId();
|
|
@@ -5213,142 +5229,291 @@ public class SimulationProjectServiceImpl implements SimulationProjectService {
|
|
|
referenceLibList.add(sceneId);
|
|
|
}
|
|
|
}
|
|
|
+ List<SceneNaturalPO> naturalData = null;
|
|
|
+ List<StandardsRegulationsPO> regulationData = null;
|
|
|
+ List<SceneAccidentPO> accidentData = null;
|
|
|
+ List<SceneReferenceLibPO> referenceLibData = null;
|
|
|
+ if (CollectionUtil.isNotEmpty(naturalList)) {
|
|
|
+ SceneNaturalParam sceneNaturalParam = new SceneNaturalParam();
|
|
|
+ sceneNaturalParam.setIds(naturalList.toArray(new String[0]));
|
|
|
+ naturalData = sceneNaturalMapper.querySceneNaturalList(sceneNaturalParam);
|
|
|
+ }
|
|
|
+ if (CollectionUtil.isNotEmpty(regulationlList)) {
|
|
|
+ StandardsRegulationsParam standardsRegulationsParam = new StandardsRegulationsParam();
|
|
|
+ standardsRegulationsParam.setIds(regulationlList.toArray(new String[0]));
|
|
|
+ regulationData = sceneStandardsRegulationsMapper.queryStandardsRegulationsList(standardsRegulationsParam);
|
|
|
+ }
|
|
|
+ if (CollectionUtil.isNotEmpty(accidentList)) {
|
|
|
+ SceneAccidentParam params = new SceneAccidentParam();
|
|
|
+ params.setIds(accidentList.toArray(new String[0]));
|
|
|
+ accidentData = sceneAccidentMapper.querySceneAccidentList(params);
|
|
|
+ }
|
|
|
+ if (CollectionUtil.isNotEmpty(referenceLibList)) {
|
|
|
+ SceneReferenceLibSelectParam params = new SceneReferenceLibSelectParam();
|
|
|
+ params.setIds(referenceLibList.toArray(new String[0]));
|
|
|
+ referenceLibData = sceneReferenceLibMapper.querySceneReferenceLibList(params);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (CollectionUtil.isNotEmpty(naturalData)) {
|
|
|
+ String tempPath = rootPath + File.separator + "自然驾驶场景.csv";
|
|
|
+ FileWriter naturalWriter = new FileWriter(tempPath);
|
|
|
+ // 写入 CSV 头部信息
|
|
|
+ naturalWriter.write("场景名称,自车行为,目标行为,交通情况,道路,基础设施,自然环境,临时性操纵,标签,复杂度,复杂度等级,危险度,危险度等级,算法得分\n");
|
|
|
+ for (SceneNaturalPO sceneNaturalPO : naturalData) {
|
|
|
+ getNaturalLabel(sceneNaturalPO);
|
|
|
+ String[] tempNatural = new String[14];
|
|
|
+ SceneComplexityPO sceneComplexityPO = firstComplexityPOMap.get(sceneNaturalPO.getNaturalId());
|
|
|
+ SceneRiskPO sceneRiskPO = firstRiskPOMap.get(sceneNaturalPO.getNaturalId());
|
|
|
+ tempNatural[0] = sceneNaturalPO.getNaturalName();
|
|
|
+ tempNatural[1] = sceneNaturalPO.getSelfBehavior();
|
|
|
+ tempNatural[2] = sceneNaturalPO.getTargetBehavior();
|
|
|
+ tempNatural[3] = sceneNaturalPO.getPatency();
|
|
|
+ tempNatural[4] = sceneNaturalPO.getRoadType();
|
|
|
+ tempNatural[5] = sceneNaturalPO.getRoadSafetySigns();
|
|
|
+ tempNatural[6] = sceneNaturalPO.getNaturalDisaster();
|
|
|
+ tempNatural[7] = "临时性操纵";
|
|
|
+ tempNatural[8] = sceneNaturalPO.getLabel();
|
|
|
+ tempNatural[9] = sceneComplexityPO == null ? null : sceneComplexityPO.getComplexity();
|
|
|
+ tempNatural[10] = sceneComplexityPO == null ? null : sceneComplexityPO.getComplexityLevel();
|
|
|
+ tempNatural[11] = sceneRiskPO == null ? null : sceneRiskPO.getRisk();
|
|
|
+ tempNatural[12] = sceneRiskPO == null ? null : sceneRiskPO.getRiskLevel();
|
|
|
+ tempNatural[13] = String.valueOf(scoreMap.get(sceneNaturalPO.getNaturalId()));
|
|
|
+ naturalWriter.write(Arrays.toString(tempNatural));
|
|
|
+ }
|
|
|
+ naturalWriter.close();
|
|
|
+ ZipEntry naturalEntry = new ZipEntry(tempPath);
|
|
|
+ zos.putNextEntry(naturalEntry);
|
|
|
+ BufferedInputStream in = new BufferedInputStream(Files.newInputStream(Paths.get(tempPath)));
|
|
|
+ while ((len = in.read(buffer)) != -1) {
|
|
|
+ zos.write(buffer, 0, len);
|
|
|
+ }
|
|
|
+ in.close();
|
|
|
+ }
|
|
|
|
|
|
- for (ManualProjectTaskVo task : manualProjectTaskVos) {
|
|
|
- log.info("当前下载进度为 {}/{}。", i++, manualProjectTaskVos.size());
|
|
|
- String taskId = task.getId();
|
|
|
- String runResultFilePath = task.getRunResultFilePath();
|
|
|
- if (!isEmpty(runResultFilePath)) {
|
|
|
- // 获取场景名
|
|
|
- SceneBaseInfoVo sceneBaseInfoVo = getSceneNameAndOther(task.getSceneId(), task.getSceneType());
|
|
|
- String sceneName = sceneBaseInfoVo.getCommonSceneName();
|
|
|
- // 任务包路径
|
|
|
- String taskPagePath = rootPath + File.separator + sceneName + "- " + taskId.substring(0, 8);
|
|
|
- // 视频文件路径
|
|
|
- MinioParameter minioParameter1 = new MinioParameter();
|
|
|
- minioParameter1.setObjectName(runResultFilePath);
|
|
|
- ResponseBodyVO<List<String>> list = fileDownService.list(minioParameter1);
|
|
|
- List<String> info = list.getInfo();
|
|
|
- // 防止下载两次,因为结果目录里有测试用的同名文件
|
|
|
- boolean mp4_done = false;
|
|
|
- boolean Ego_csv_done = false;
|
|
|
- boolean evaluation_csv_done = false;
|
|
|
-
|
|
|
- for (String s : info) {
|
|
|
- String fileName;
|
|
|
- String zipPath;
|
|
|
- // 获取文件名
|
|
|
- if (s.contains("/")) {
|
|
|
- fileName = s.substring(s.lastIndexOf("/") + 1);
|
|
|
- } else {
|
|
|
- fileName = s.substring(s.lastIndexOf("\\") + 1);
|
|
|
- }
|
|
|
- zipPath = taskPagePath + File.separator + fileName;
|
|
|
- // 文件后缀
|
|
|
- String substring = s.substring(s.lastIndexOf(".") + 1);
|
|
|
- if ("mp4".equals(substring)) {
|
|
|
- if (mp4_done) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- // mp4视频文件导出
|
|
|
- MinioParameter minioParameter2 = new MinioParameter();
|
|
|
- minioParameter2.setObjectName(s);
|
|
|
- Response download2 = fileDownService.download(minioParameter2);
|
|
|
- Response.Body body2 = download2.body();
|
|
|
- ZipEntry entry2 = new ZipEntry(zipPath);
|
|
|
- zos.putNextEntry(entry2);
|
|
|
- BufferedInputStream in = new BufferedInputStream(body2.asInputStream());
|
|
|
- while ((len = in.read(buffer)) != -1) {
|
|
|
- zos.write(buffer, 0, len);
|
|
|
- }
|
|
|
- in.close();
|
|
|
- mp4_done = true;
|
|
|
- } else if ("Ego.csv".equals(fileName)) {
|
|
|
- if (Ego_csv_done) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- MinioParameter minioParameter = new MinioParameter();
|
|
|
- if (s.contains("/")) {
|
|
|
- minioParameter.setObjectName(runResultFilePath + "/" + fileName);
|
|
|
- } else {
|
|
|
- minioParameter.setObjectName(runResultFilePath + "\\" + fileName);
|
|
|
- }
|
|
|
-
|
|
|
- Response download = fileDownService.download(minioParameter);
|
|
|
- Response.Body body = download.body();
|
|
|
-
|
|
|
- // 任务文件路径
|
|
|
- String taskFilePath = taskPagePath + File.separator + fileName;
|
|
|
-
|
|
|
- ZipEntry entry = new ZipEntry(taskFilePath);
|
|
|
- zos.putNextEntry(entry);
|
|
|
- BufferedInputStream in = new BufferedInputStream(body.asInputStream());
|
|
|
- while ((len = in.read(buffer)) != -1) {
|
|
|
- zos.write(buffer, 0, len);
|
|
|
- }
|
|
|
- in.close();
|
|
|
- Ego_csv_done = true;
|
|
|
- } else if ("evaluation.csv".equals(fileName)) {
|
|
|
- if (evaluation_csv_done) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- MinioParameter minioParameter = new MinioParameter();
|
|
|
- if (s.contains("/")) {
|
|
|
- minioParameter.setObjectName(runResultFilePath + "/" + fileName);
|
|
|
- } else {
|
|
|
- minioParameter.setObjectName(runResultFilePath + "\\" + fileName);
|
|
|
- }
|
|
|
-
|
|
|
- Response download = fileDownService.download(minioParameter);
|
|
|
- Response.Body body = download.body();
|
|
|
-
|
|
|
- // 任务文件路径
|
|
|
- String taskFilePath = taskPagePath + File.separator + fileName;
|
|
|
+ if (CollectionUtil.isNotEmpty(regulationData)) {
|
|
|
+ String tempPath = rootPath + File.separator + "标准法规场景.csv";
|
|
|
+ FileWriter regulationWriter = new FileWriter(tempPath);
|
|
|
+ // 写入 CSV 头部信息
|
|
|
+ regulationWriter.write("场景名称,法规类型,标准类型,标签,复杂度,复杂度等级,危险度,危险度等级,算法得分\n");
|
|
|
+ for (StandardsRegulationsPO tempPo : regulationData) {
|
|
|
+ String[] tempStr = new String[9];
|
|
|
+ SceneComplexityPO sceneComplexityPO = firstComplexityPOMap.get(tempPo.getRegulationsId());
|
|
|
+ SceneRiskPO sceneRiskPO = firstRiskPOMap.get(tempPo.getRegulationsId());
|
|
|
+ tempStr[0] = tempPo.getSceneName();
|
|
|
+ tempStr[1] = tempPo.getRegulationType();
|
|
|
+ tempStr[2] = tempPo.getStandardType();
|
|
|
+ tempStr[3] = tempPo.getLabel();
|
|
|
+ tempStr[4] = sceneComplexityPO == null ? null : sceneComplexityPO.getComplexity();
|
|
|
+ tempStr[5] = sceneComplexityPO == null ? null : sceneComplexityPO.getComplexityLevel();
|
|
|
+ tempStr[6] = sceneRiskPO == null ? null : sceneRiskPO.getRisk();
|
|
|
+ tempStr[7] = sceneRiskPO == null ? null : sceneRiskPO.getRiskLevel();
|
|
|
+ tempStr[8] = String.valueOf(scoreMap.get(tempPo.getRegulationsId()));
|
|
|
+ regulationWriter.write(Arrays.toString(tempStr));
|
|
|
+ }
|
|
|
+ regulationWriter.close();
|
|
|
+ ZipEntry entry = new ZipEntry(tempPath);
|
|
|
+ zos.putNextEntry(entry);
|
|
|
+ BufferedInputStream in = new BufferedInputStream(Files.newInputStream(Paths.get(tempPath)));
|
|
|
+ while ((len = in.read(buffer)) != -1) {
|
|
|
+ zos.write(buffer, 0, len);
|
|
|
+ }
|
|
|
+ in.close();
|
|
|
+ }
|
|
|
|
|
|
- ZipEntry entry = new ZipEntry(taskFilePath);
|
|
|
- zos.putNextEntry(entry);
|
|
|
- BufferedInputStream in = new BufferedInputStream(body.asInputStream());
|
|
|
- while ((len = in.read(buffer)) != -1) {
|
|
|
- zos.write(buffer, 0, len);
|
|
|
- }
|
|
|
- in.close();
|
|
|
- evaluation_csv_done = true;
|
|
|
- }
|
|
|
- }
|
|
|
+ if (CollectionUtil.isNotEmpty(accidentData)) {
|
|
|
+ String tempPath = rootPath + File.separator + "交通事故场景.csv";
|
|
|
+ FileWriter accidentWriter = new FileWriter(tempPath);
|
|
|
+ // 写入 CSV 头部信息
|
|
|
+ accidentWriter.write("场景名称,自车驾驶行为,目标驾驶行为,自车反应行为,冲突行为,冲突类型,标签,复杂度,复杂度等级,危险度,危险度等级,算法得分\n");
|
|
|
+ for (SceneAccidentPO tempPo : accidentData) {
|
|
|
+ getAccidentLabel(tempPo);
|
|
|
+ String[] tempStr = new String[12];
|
|
|
+ SceneComplexityPO sceneComplexityPO = firstComplexityPOMap.get(tempPo.getAccidentId());
|
|
|
+ SceneRiskPO sceneRiskPO = firstRiskPOMap.get(tempPo.getAccidentId());
|
|
|
+ tempStr[0] = tempPo.getSceneName();
|
|
|
+ tempStr[1] = tempPo.getSelfDriving();
|
|
|
+ tempStr[2] = tempPo.getTargetDriving();
|
|
|
+ tempStr[3] = tempPo.getSelfReaction();
|
|
|
+ tempStr[4] = tempPo.getConflictBehavior();
|
|
|
+ tempStr[5] = tempPo.getConflictType();
|
|
|
+ tempStr[6] = tempPo.getLabel();
|
|
|
+ tempStr[7] = sceneComplexityPO == null ? null : sceneComplexityPO.getComplexity();
|
|
|
+ tempStr[8] = sceneComplexityPO == null ? null : sceneComplexityPO.getComplexityLevel();
|
|
|
+ tempStr[9] = sceneRiskPO == null ? null : sceneRiskPO.getRisk();
|
|
|
+ tempStr[10] = sceneRiskPO == null ? null : sceneRiskPO.getRiskLevel();
|
|
|
+ tempStr[11] = String.valueOf(scoreMap.get(tempPo.getAccidentId()));
|
|
|
+ accidentWriter.write(Arrays.toString(tempStr));
|
|
|
+ }
|
|
|
+ accidentWriter.close();
|
|
|
+ ZipEntry entry = new ZipEntry(tempPath);
|
|
|
+ zos.putNextEntry(entry);
|
|
|
+ BufferedInputStream in = new BufferedInputStream(Files.newInputStream(Paths.get(tempPath)));
|
|
|
+ while ((len = in.read(buffer)) != -1) {
|
|
|
+ zos.write(buffer, 0, len);
|
|
|
}
|
|
|
+ in.close();
|
|
|
}
|
|
|
|
|
|
- // 打包pdf
|
|
|
- if (param.getIsPagePdf() != null && param.getIsPagePdf()) {
|
|
|
- // 获取工作信息
|
|
|
- SimulationManualProjectPO p = simulationManualProjectMapper.selectProjectBaseById(param);
|
|
|
- final String algorithmName = algorithmMapper.selectAlgorithmNameByAlgorithmId(spo.getAlgorithm());
|
|
|
|
|
|
- pdfFile = new File(param.getLocalPdfFilePath());
|
|
|
- FileInputStream fileInputStream = new FileInputStream(pdfFile);
|
|
|
- BufferedInputStream in = new BufferedInputStream(fileInputStream);
|
|
|
- ZipEntry entry = new ZipEntry(rootPath + File.separator + algorithmName + "评价报告.pdf");
|
|
|
+ if (CollectionUtil.isNotEmpty(referenceLibData)) {
|
|
|
+ String tempPath = rootPath + File.separator + "基准场景库.csv";
|
|
|
+ FileWriter referenceLibWriter = new FileWriter(tempPath);
|
|
|
+ referenceLibWriter.write("场景名称,主车动作,他车动作,天气,道路类型,道路几何-平面,道路几何-纵断面,支持智驾功能,运行区域,场景描述,标签,复杂度,复杂度等级,危险度,危险度等级,算法得分\n");
|
|
|
+ for (SceneReferenceLibPO tempPo : referenceLibData) {
|
|
|
+ getReferenceLibLabel(tempPo);
|
|
|
+ String[] tempStr = new String[16];
|
|
|
+ SceneComplexityPO sceneComplexityPO = firstComplexityPOMap.get(tempPo.getSceneId());
|
|
|
+ SceneRiskPO sceneRiskPO = firstRiskPOMap.get(tempPo.getSceneId());
|
|
|
+ tempStr[0] = tempPo.getSceneName();
|
|
|
+ tempStr[1] = tempPo.getMainBehavior();
|
|
|
+ tempStr[2] = tempPo.getOtherBehavior();
|
|
|
+ tempStr[3] = tempPo.getWeather();
|
|
|
+ tempStr[4] = tempPo.getRoadType();
|
|
|
+ tempStr[5] = tempPo.getRoadGeometryPlane();
|
|
|
+ tempStr[6] = tempPo.getRoadGeometryVertical();
|
|
|
+ tempStr[7] = tempPo.getAutoDriveFunction();
|
|
|
+ tempStr[8] = tempPo.getOperationArea();
|
|
|
+ tempStr[9] = tempPo.getSceneDescription();
|
|
|
+ tempStr[10] = tempPo.getLabel();
|
|
|
+ tempStr[11] = sceneComplexityPO == null ? null : sceneComplexityPO.getComplexity();
|
|
|
+ tempStr[12] = sceneComplexityPO == null ? null : sceneComplexityPO.getComplexityLevel();
|
|
|
+ tempStr[13] = sceneRiskPO == null ? null : sceneRiskPO.getRisk();
|
|
|
+ tempStr[14] = sceneRiskPO == null ? null : sceneRiskPO.getRiskLevel();
|
|
|
+ tempStr[15] = String.valueOf(scoreMap.get(tempPo.getSceneId()));
|
|
|
+ referenceLibWriter.write(Arrays.toString(tempStr));
|
|
|
+ }
|
|
|
+ referenceLibWriter.close();
|
|
|
+ ZipEntry entry = new ZipEntry(tempPath);
|
|
|
zos.putNextEntry(entry);
|
|
|
+ BufferedInputStream in = new BufferedInputStream(Files.newInputStream(Paths.get(tempPath)));
|
|
|
while ((len = in.read(buffer)) != -1) {
|
|
|
zos.write(buffer, 0, len);
|
|
|
}
|
|
|
in.close();
|
|
|
}
|
|
|
+ zos.close();
|
|
|
+ } catch (Exception ex) {
|
|
|
+ log.error("下载失败", ex);
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
- } catch (Exception e) {
|
|
|
- e.printStackTrace();
|
|
|
- } finally {
|
|
|
- try {
|
|
|
- if (zos != null) {
|
|
|
- zos.close();
|
|
|
- }
|
|
|
- if (pdfFile != null) {
|
|
|
- pdfFile.delete();
|
|
|
- }
|
|
|
- } catch (IOException e) {
|
|
|
- e.printStackTrace();
|
|
|
+ private void getAccidentLabel(SceneAccidentPO po) {
|
|
|
+ if (po.getConflictBehavior().contains("追尾")) {
|
|
|
+ po.setLabel("追尾");
|
|
|
+ }
|
|
|
+ if (po.getTargetDriving().contains("切入")) {
|
|
|
+ if (ObjectUtil.isNull(po.getLabel())) {
|
|
|
+ po.setLabel("目标车切入");
|
|
|
+ } else {
|
|
|
+ po.setLabel(po.getLabel() + ",目标车切入");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ if (po.getTargetDriving().contains("沿弯道行驶")) {
|
|
|
+ if (ObjectUtil.isNull(po.getLabel())) {
|
|
|
+ po.setLabel("目标车沿弯道行驶");
|
|
|
+ } else {
|
|
|
+ po.setLabel(po.getLabel() + ",目标车沿弯道行驶");
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ if (po.getConflictType().contains("机动车-机动车")) {
|
|
|
+ if (ObjectUtil.isNull(po.getLabel())) {
|
|
|
+ po.setLabel("机动车-机动车冲突");
|
|
|
+ } else {
|
|
|
+ po.setLabel(po.getLabel() + ",机动车-机动车冲突");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void getReferenceLibLabel(SceneReferenceLibPO po) {
|
|
|
+ if (po.getRoadType().equals("高速")) {
|
|
|
+ if (ObjectUtil.isNull(po.getLabel())) {
|
|
|
+ po.setLabel("高速");
|
|
|
+ } else {
|
|
|
+ po.setLabel(po.getLabel() + ",高速");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (po.getOtherBehavior().contains("机动车从左侧切入成功") || po.getOtherBehavior().contains("机动车从右侧切入成功")) {
|
|
|
+ if (ObjectUtil.isNull(po.getLabel())) {
|
|
|
+ po.setLabel("切入");
|
|
|
+ } else {
|
|
|
+ po.setLabel(po.getLabel() + ",切入");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (po.getOtherBehavior().equals("机动车向左侧切出成功") || po.getOtherBehavior().equals("机动车向右侧切出成功")) {
|
|
|
+ if (ObjectUtil.isNull(po.getLabel())) {
|
|
|
+ po.setLabel("切出");
|
|
|
+ } else {
|
|
|
+ po.setLabel(po.getLabel() + ",切出");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (po.getMainBehavior().contains("直路掉头") || po.getMainBehavior().contains("路口掉头")) {
|
|
|
+ if (ObjectUtil.isNull(po.getLabel())) {
|
|
|
+ po.setLabel("掉头");
|
|
|
+ } else {
|
|
|
+ po.setLabel(po.getLabel() + ",掉头");
|
|
|
}
|
|
|
+ }
|
|
|
+ if (po.getMainBehavior().contains("向左变道成功") || po.getMainBehavior().equals("向右变道成功") || po.getMainBehavior().contains("向左连续变道") || po.getMainBehavior().indexOf("向右连续变道") > -1 || po.getMainBehavior().indexOf("向左变道超车") > -1 || po.getMainBehavior().indexOf("向右变道超车") > -1) {
|
|
|
+ if (ObjectUtil.isNull(po.getLabel())) {
|
|
|
+ po.setLabel("变道");
|
|
|
+ } else {
|
|
|
+ po.setLabel(po.getLabel() + ",变道");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
+ private void getNaturalLabel(SceneNaturalPO sceneNaturalPO) {
|
|
|
+ if (sceneNaturalPO.getRoadType().equals("高速")) {
|
|
|
+ if (ObjectUtil.isNull(sceneNaturalPO.getLabel())) {
|
|
|
+ sceneNaturalPO.setLabel("高速");
|
|
|
+ } else {
|
|
|
+ sceneNaturalPO.setLabel(sceneNaturalPO.getLabel() + ",高速");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (sceneNaturalPO.getRamp().equals("是")) {
|
|
|
+ if (ObjectUtil.isNull(sceneNaturalPO.getLabel())) {
|
|
|
+ sceneNaturalPO.setLabel("匝道");
|
|
|
+ } else {
|
|
|
+ sceneNaturalPO.setLabel(sceneNaturalPO.getLabel() + ",匝道");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (sceneNaturalPO.getTunnel().equals("是")) {
|
|
|
+ if (ObjectUtil.isNull(sceneNaturalPO.getLabel())) {
|
|
|
+ sceneNaturalPO.setLabel("隧道");
|
|
|
+ } else {
|
|
|
+ sceneNaturalPO.setLabel(sceneNaturalPO.getLabel() + ",隧道");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (sceneNaturalPO.getTargetBehavior().contains("机动车从左侧切入成功") || sceneNaturalPO.getTargetBehavior().contains("机动车从右侧切入成功")) {
|
|
|
+ if (ObjectUtil.isNull(sceneNaturalPO.getLabel())) {
|
|
|
+ sceneNaturalPO.setLabel("切入");
|
|
|
+ } else {
|
|
|
+ sceneNaturalPO.setLabel(sceneNaturalPO.getLabel() + ",切入");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (sceneNaturalPO.getTargetBehavior().equals("机动车向左侧切出成功") || sceneNaturalPO.getTargetBehavior().equals("机动车向右侧切出成功")) {
|
|
|
+ if (ObjectUtil.isNull(sceneNaturalPO.getLabel())) {
|
|
|
+ sceneNaturalPO.setLabel("切出");
|
|
|
+ } else {
|
|
|
+ sceneNaturalPO.setLabel(sceneNaturalPO.getLabel() + ",切出");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (sceneNaturalPO.getSelfBehavior().contains("直路掉头") || sceneNaturalPO.getSelfBehavior().contains("路口掉头")) {
|
|
|
+ if (ObjectUtil.isNull(sceneNaturalPO.getLabel())) {
|
|
|
+ sceneNaturalPO.setLabel("掉头");
|
|
|
+ } else {
|
|
|
+ sceneNaturalPO.setLabel(sceneNaturalPO.getLabel() + ",掉头");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (sceneNaturalPO.getSelfBehavior().contains("向左变道成功") || sceneNaturalPO.getSelfBehavior().equals("向右变道成功") || sceneNaturalPO.getSelfBehavior().contains("向左连续变道") || sceneNaturalPO.getSelfBehavior().indexOf("向右连续变道") > -1 || sceneNaturalPO.getSelfBehavior().indexOf("向左变道超车") > -1 || sceneNaturalPO.getSelfBehavior().indexOf("向右变道超车") > -1) {
|
|
|
+ if (ObjectUtil.isNull(sceneNaturalPO.getLabel())) {
|
|
|
+ sceneNaturalPO.setLabel("变道");
|
|
|
+ } else {
|
|
|
+ sceneNaturalPO.setLabel(sceneNaturalPO.getLabel() + ",变道");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|