| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.iail.IAILMDK; |
| | | import com.iail.model.IAILModel; |
| | | import com.iailab.module.model.common.enums.CommonConstant; |
| | | import com.iailab.module.model.mcs.sche.entity.StScheduleModelEntity; |
| | | import com.iailab.module.model.mcs.sche.entity.StScheduleModelSettingEntity; |
| | | import com.iailab.module.model.mcs.sche.entity.StScheduleSchemeEntity; |
| | |
| | | import com.iailab.module.model.mdk.sample.dto.SampleData; |
| | | import com.iailab.module.model.mdk.schedule.ScheduleModelHandler; |
| | | import com.iailab.module.model.mdk.vo.ScheduleResultVO; |
| | | import com.iailab.module.model.mpk.common.utils.DllUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | param2Values[count] = settings_predict; |
| | | |
| | | //打印参数 |
| | | log.info("##############调度模型:modelId=" + modelId + " ##########################"); |
| | | log.info("##############调度模型:scheduleScheme=" + scheduleScheme.getCode() + " ##########################"); |
| | | JSONObject jsonObjNewModelBean = new JSONObject(); |
| | | jsonObjNewModelBean.put("newModelBean", newModelBean); |
| | | log.info(String.valueOf(jsonObjNewModelBean)); |
| | |
| | | jsonObjParam2Values.put("param2Values", param2Values); |
| | | log.info(String.valueOf(jsonObjParam2Values)); |
| | | |
| | | //IAILMDK.run |
| | | HashMap<String, Object> result = IAILMDK.run(newModelBean, param2Values); |
| | | //运行模型 |
| | | HashMap<String, Object> modelResult = DllUtils.run(newModelBean, param2Values, scheduleScheme.getMpkprojectid()); |
| | | if (!modelResult.containsKey(CommonConstant.MDK_STATUS_CODE) || !modelResult.containsKey(CommonConstant.MDK_RESULT) || |
| | | !modelResult.get(CommonConstant.MDK_STATUS_CODE).toString().equals(CommonConstant.MDK_STATUS_100)) { |
| | | throw new RuntimeException("模型结果异常:" + modelResult); |
| | | } |
| | | modelResult = (HashMap<String, Object>) modelResult.get(CommonConstant.MDK_RESULT); |
| | | |
| | | //打印结果 |
| | | JSONObject jsonObjResult = new JSONObject(); |
| | | jsonObjResult.put("result", result); |
| | | jsonObjResult.put("result", modelResult); |
| | | log.info(String.valueOf(jsonObjResult)); |
| | | log.info("调度模型计算完成:modelId=" + modelId + result); |
| | | |
| | | //5.返回调度结果 |
| | | scheduleResult.setResult(result); |
| | | scheduleResult.setResult(modelResult); |
| | | scheduleResult.setModelId(modelId); |
| | | scheduleResult.setSchemeId(scheduleScheme.getId()); |
| | | scheduleResult.setScheduleTime(scheduleTime); |