修改场景状态
This commit is contained in:
parent
10970ab165
commit
e537effbe3
@ -610,6 +610,13 @@ public class ProjectServiceImpl
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map<String, Object> initSimulation(String projectId, String scenarioId, Map<String, Object> params) {
|
public Map<String, Object> initSimulation(String projectId, String scenarioId, Map<String, Object> params) {
|
||||||
|
//改变场景状态
|
||||||
|
Scenario scenario = new Scenario();
|
||||||
|
scenario.setScenarioId(scenarioId);
|
||||||
|
scenario.setStatus("1");
|
||||||
|
scenarioService.updateById(scenario);
|
||||||
|
|
||||||
|
|
||||||
Map<String, Object> out = new HashMap<>();
|
Map<String, Object> out = new HashMap<>();
|
||||||
out.put("projectId", projectId);
|
out.put("projectId", projectId);
|
||||||
out.put("scenarioId", scenarioId);
|
out.put("scenarioId", scenarioId);
|
||||||
@ -632,6 +639,8 @@ public class ProjectServiceImpl
|
|||||||
out.put("frames", frames);
|
out.put("frames", frames);
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
System.out.println("root="+root);
|
||||||
|
|
||||||
Map<String, String> devToMat = buildDeviceMaterialMap(root, issues);
|
Map<String, String> devToMat = buildDeviceMaterialMap(root, issues);
|
||||||
Map<String, Map<String, Double>> devStatic = new HashMap<>();
|
Map<String, Map<String, Double>> devStatic = new HashMap<>();
|
||||||
Map<String, Map<String, Object>> devInfluence = new HashMap<>();
|
Map<String, Map<String, Object>> devInfluence = new HashMap<>();
|
||||||
@ -640,12 +649,21 @@ public class ProjectServiceImpl
|
|||||||
Map<String, Map<String, Object>> matInfluence = new HashMap<>();
|
Map<String, Map<String, Object>> matInfluence = new HashMap<>();
|
||||||
parseMaterialStaticsAndInfluences(root, matStatic, matInfluence, issues);
|
parseMaterialStaticsAndInfluences(root, matStatic, matInfluence, issues);
|
||||||
Map<String, Map<String, Double>> matStaticDb = buildMaterialStaticFromDb(devToMat);
|
Map<String, Map<String, Double>> matStaticDb = buildMaterialStaticFromDb(devToMat);
|
||||||
|
System.out.println("devStatic="+devStatic);
|
||||||
|
System.out.println("devInfluence="+devInfluence);
|
||||||
|
System.out.println("matStatic="+matStatic);
|
||||||
|
System.out.println("matInfluence="+matInfluence);
|
||||||
|
|
||||||
|
System.out.println("matStaticDb="+matStaticDb);
|
||||||
|
System.out.println("issues="+issues);
|
||||||
|
|
||||||
List<Event> events = eventService.list(
|
List<Event> events = eventService.list(
|
||||||
new QueryWrapper<Event>()
|
new QueryWrapper<Event>()
|
||||||
.select("event_id","scenario_id","device_id","material_id","attr_changes","trigger_time","created_at","modifier")
|
.select("event_id","scenario_id","device_id","material_id","attr_changes","trigger_time","created_at","modifier")
|
||||||
.eq("scenario_id", scenarioId)
|
.eq("scenario_id", scenarioId)
|
||||||
);
|
);
|
||||||
Map<String, Object> valueProviders = buildValueProviders(events, issues);
|
Map<String, Object> valueProviders = buildValueProviders(events, issues);
|
||||||
|
//获取时点序列
|
||||||
List<Long> timePoints = collectTimePoints(valueProviders);
|
List<Long> timePoints = collectTimePoints(valueProviders);
|
||||||
if (timePoints.isEmpty()) {
|
if (timePoints.isEmpty()) {
|
||||||
issues.add("事件为空或未提供时间点,无法生成帧");
|
issues.add("事件为空或未提供时间点,无法生成帧");
|
||||||
@ -1319,7 +1337,11 @@ public class ProjectServiceImpl
|
|||||||
//6. 调用模型进行推理,把结果写入推理结果表
|
//6. 调用模型进行推理,把结果写入推理结果表
|
||||||
deviceInferService.processDeviceInference(projectId, scenarioId, groupedDevices);
|
deviceInferService.processDeviceInference(projectId, scenarioId, groupedDevices);
|
||||||
|
|
||||||
|
//修改情景表状态
|
||||||
|
Scenario oneScenario = new Scenario();
|
||||||
|
oneScenario.setScenarioId(scenarioId);
|
||||||
|
oneScenario.setStatus("2");
|
||||||
|
scenarioService.updateById(oneScenario);
|
||||||
//var res = inferenceService.runInference(projectId, scenarioId, params);
|
//var res = inferenceService.runInference(projectId, scenarioId, params);
|
||||||
//5. 写入结果表
|
//5. 写入结果表
|
||||||
//scenarioResultMapper.insertBatch(res);
|
//scenarioResultMapper.insertBatch(res);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user