|
@@ -109,7 +109,7 @@ public class TaskDomainService {
|
|
|
String leafIndexTemplateListJson = stringRedisTemplate.opsForValue().get(leafIndexKey);
|
|
|
List<IndexTemplateEntity> allIndexTemplateList = JsonUtil.jsonToList(allIndexTemplateListJson, IndexTemplateEntity.class);
|
|
|
List<IndexTemplateEntity> leafIndexTemplateList = JsonUtil.jsonToList(leafIndexTemplateListJson, IndexTemplateEntity.class);
|
|
|
- log.info("共有 " + leafIndexTemplateList.size() + "个叶子节点:" + leafIndexTemplateListJson);
|
|
|
+ log.debug("共有 " + leafIndexTemplateList.size() + "个叶子节点:" + leafIndexTemplateListJson);
|
|
|
int maxLevel = 1; // 用于计算指标得分
|
|
|
List<LeafIndexEntity> leafIndexList = new ArrayList<>();
|
|
|
for (int i = 0; i < leafIndexTemplateList.size(); i++) {
|
|
@@ -152,17 +152,26 @@ public class TaskDomainService {
|
|
|
if (DictConstants.TASK_ANALYSIS.equals(runState)) {
|
|
|
taskMapper.updateSuccessStateWithStopTime(task2Id, DictConstants.TASK_ANALYSING, TimeUtil.getNowForMysql());
|
|
|
// 计算每个任务的得分
|
|
|
- String result1OfMinio = taskOfLeaf.getRunResultFilePath() + "/Ego.csv";
|
|
|
- String result1OfLinux = linuxTempPath + result1OfMinio;
|
|
|
- String result2OfMinio = taskOfLeaf.getRunResultFilePath() + "/evaluation.csv";
|
|
|
- String result2OfLinux = linuxTempPath + result2OfMinio;
|
|
|
- String scoreCommand = "python3 " + scoreDirectoryOfUser + "main.py " + result1OfLinux + " " + result2OfLinux + " " + taskOfLeaf.getSceneType() + " " + ruleName; // 指定打分脚本
|
|
|
+ final String runResultFilePath = taskOfLeaf.getRunResultFilePath();
|
|
|
+ final ArrayList<String> csvResultFilePaths = CollectionUtil.createArrayList(
|
|
|
+ runResultFilePath + "/Ego.csv",
|
|
|
+ runResultFilePath + "/evaluation.csv",
|
|
|
+ runResultFilePath + "/output_objectState_sensor.csv",
|
|
|
+ runResultFilePath + "/output_objectState.csv",
|
|
|
+ runResultFilePath + "/output_roadMark.csv",
|
|
|
+ runResultFilePath + "/output_roadPos.csv",
|
|
|
+ runResultFilePath + "/output_trafficSignal.csv"
|
|
|
+ );
|
|
|
+ for (String csvResultFileMinioPath : csvResultFilePaths) {
|
|
|
+ String csvResultFileLinuxPath = linuxTempPath + csvResultFileMinioPath;
|
|
|
+ log.info("下载MINIO上的结果文件:" + csvResultFileMinioPath + " 到LINUX:" + csvResultFileLinuxPath);
|
|
|
+ MinioUtil.downloadToFile(minioClient, bucketName, csvResultFileMinioPath, csvResultFileLinuxPath); // 也可改成下载到指定ip的服务器上,需要保证和打分脚本在一台机器上。
|
|
|
+ }
|
|
|
+
|
|
|
+ String scoreCommand = "python3 " + scoreDirectoryOfUser + "main.py " + (linuxTempPath + runResultFilePath + "/Ego.csv") + " " + (linuxTempPath + runResultFilePath + "/evaluation.csv") + " " + taskOfLeaf.getSceneType() + " " + ruleName; // 指定打分脚本
|
|
|
String scoreResult;
|
|
|
ScoreEntity score = null;
|
|
|
- log.debug("下载 minio 上的结果文件 " + result1OfMinio + " 和 " + result2OfMinio + " 到临时目录:" + linuxTempPath);
|
|
|
- MinioUtil.downloadToFile(minioClient, bucketName, result1OfMinio, result1OfLinux); // 也可改成下载到指定ip的服务器上,需要保证和打分脚本在一台机器上。
|
|
|
- MinioUtil.downloadToFile(minioClient, bucketName, result2OfMinio, result2OfLinux); // 也可改成下载到指定ip的服务器上,需要保证和打分脚本在一台机器上。
|
|
|
- log.debug("开始执行打分命令:" + scoreCommand);
|
|
|
+ log.info("开始执行打分命令:" + scoreCommand);
|
|
|
Runtime r = Runtime.getRuntime();
|
|
|
Process p = r.exec(scoreCommand, null, new File(scoreDirectoryOfUser));
|
|
|
BufferedReader br = new BufferedReader(new InputStreamReader(p.getInputStream()));
|
|
@@ -172,7 +181,7 @@ public class TaskDomainService {
|
|
|
sb.append(inline).append("\n");
|
|
|
}
|
|
|
scoreResult = sb.toString();
|
|
|
- log.debug("项目" + projectId + " 的任务 " + task2Id + " 打分结束,结果为:" + scoreResult);
|
|
|
+ log.info("项目" + projectId + " 的任务 " + task2Id + " 打分结束,结果为:" + scoreResult);
|
|
|
String replace = StringUtil.replace(scoreResult, "'", "\"");
|
|
|
try {
|
|
|
score = JsonUtil.jsonToBean(replace, ScoreEntity.class);
|
|
@@ -356,7 +365,7 @@ public class TaskDomainService {
|
|
|
// 查询并保存项目报告
|
|
|
projectDomainService.selectProjectReportById(projectType, projectId);
|
|
|
// 如果使用算法平台算法则修改状态为测试完成
|
|
|
- projectDomainService.checkAlgorithmIsExpand(projectType,projectId,DictConstants.ALGORITHM_EXPAND_STATUS_TESTED);
|
|
|
+ projectDomainService.checkAlgorithmIsExpand(projectType, projectId, DictConstants.ALGORITHM_EXPAND_STATUS_TESTED);
|
|
|
}
|
|
|
|
|
|
|