예제 #1
0
        public static void ConstructInferResult(ClipsEngine.Result oClipsInferResult,
                                                List <vMRClsDef.DataModel> lstNewFact, ref vMRClsDef.OutputInfo oOutputInfo)
        {
            //触发事件的中文名信息获取
            oOutputInfo.oTriggeringEvent.oEvent.strEventCNName = ClipsFactObtain.ObtainEventCNNamewithEventName(oOutputInfo);
            //诊断或治疗结构化推理结论
            oOutputInfo.oInference.lstStructedInferMessage.AddRange(lstNewFact);

            //诊断、治疗和自我监测非结构化推理结论
            for (int i = 0; i < oClipsInferResult.Recommendations.Count; i++)
            {
                vMRClsDef.UnStructMessage oRecommendation = new vMRClsDef.UnStructMessage();
                oRecommendation.strUnStructMessage = oClipsInferResult.Recommendations[i];
                oOutputInfo.oInference.lstUnstructedInferenceMessage.Add(oRecommendation);
            }

            //推理所缺数据
            for (int j = 0; j < oClipsInferResult.DataNotice.Data.Count; j++)
            {
                vMRClsDef.DataModel oShortDataModel = new vMRClsDef.DataModel();
                oShortDataModel.strDataName   = oClipsInferResult.DataNotice.Data[j];
                oShortDataModel.strDataCNName = ClipsFactObtain.ObtainDataCNNamewithDataName(oOutputInfo, oShortDataModel.strDataName);
                oOutputInfo.lstShortDataModel.Add(oShortDataModel);
            }

            //解释过程
            for (int k = 0; k < oClipsInferResult.lstInInterpretation.Count; k++)
            {
                ExplanationService.ConstructExplanation(oClipsInferResult.lstInInterpretation[k], ref oOutputInfo);
            }
        }
예제 #2
0
 /// <summary>
 /// 推理引擎端决策代理服务具体实现,UI端调用
 /// </summary>
 /// <param name="oIEvMRInputDataValue"></param>
 /// <param name="oIEvMROutput"></param>
 /// <returns></returns>
 public static bool vMRDataValueFromUItoIE(vMRClsDef.IEvMRInput oIEvMRInputDataValue, ref vMRClsDef.IEvMROutput oIEvMROutput)
 {
     oIEvMROutput.oRoles = oIEvMRInputDataValue.oRoles;
     foreach (vMRClsDef.InputDataModel oInputDataModel in oIEvMRInputDataValue.lstInputDataModel)
     {
         List <vMRClsDef.DataModel> lstDataModelForIE = new List <vMRClsDef.DataModel>();
         vMRClsDef.OutputInfo       oIEOutputInfo     = new vMRClsDef.OutputInfo();
         FactConstruct.FormFactInDataModel(oInputDataModel, ref lstDataModelForIE);
         oIEOutputInfo.oTriggeringEvent = oInputDataModel.oTriggeringEvent;
         InferenceService.BeginInference(oIEvMROutput.oRoles, lstDataModelForIE, ref oIEOutputInfo);
         ExplanationService.BeginExplanation();
         oIEvMROutput.lstOutputInfo.Add(oIEOutputInfo);
     }
     return(true);
 }