Ejemplo n.º 1
0
 /// <summary>コンストラクタ
 /// </summary>
 /// <param name="Result">評価結果</param>
 /// <param name="Date">日付</param>
 /// <param name="Message">メッセージ</param>
 public CEvaluationItem(EEvaluationResult Result, CScheduledDate Date, string Message)
 {
     id      = CEvaluationItem.NextID;
     result  = Result;
     sdate   = Date;
     message = Message;
 }
Ejemplo n.º 2
0
 public override EEvaluationResult EvaluateFaultClassRule(Dictionary <string, List <double> > variables)
 {
     RuleExpression[] array = this.operands;
     for (int i = 0; i < array.Length; i++)
     {
         EEvaluationResult eevaluationResult = array[i].EvaluateFaultClassRule(variables);
         if (eevaluationResult != EEvaluationResult.INVALID)
         {
             return(eevaluationResult);
         }
     }
     return(EEvaluationResult.INVALID);
 }
Ejemplo n.º 3
0
 public override EEvaluationResult EvaluateEmpiricalRule(long[] premises)
 {
     RuleExpression[] array = this.operands;
     for (int i = 0; i < array.Length; i++)
     {
         EEvaluationResult eevaluationResult = array[i].EvaluateEmpiricalRule(premises);
         if (eevaluationResult != EEvaluationResult.INVALID)
         {
             return(eevaluationResult);
         }
     }
     return(EEvaluationResult.INVALID);
 }
Ejemplo n.º 4
0
        public override EEvaluationResult EvaluateVariantRule(ClientDefinition client, CharacteristicSet baseConfiguration, EcuConfiguration ecus)
        {
            EEvaluationResult eevaluationResult = this.operand.EvaluateVariantRule(client, baseConfiguration, ecus);

            if (eevaluationResult == EEvaluationResult.VALID)
            {
                return(EEvaluationResult.INVALID);
            }
            if (eevaluationResult == EEvaluationResult.INVALID)
            {
                return(EEvaluationResult.VALID);
            }
            return(eevaluationResult);
        }
Ejemplo n.º 5
0
        public override EEvaluationResult EvaluateFaultClassRule(Dictionary <string, List <double> > variables)
        {
            EEvaluationResult eevaluationResult = this.operand.EvaluateFaultClassRule(variables);

            if (eevaluationResult == EEvaluationResult.VALID)
            {
                return(EEvaluationResult.INVALID);
            }
            if (eevaluationResult == EEvaluationResult.INVALID)
            {
                return(EEvaluationResult.VALID);
            }
            return(eevaluationResult);
        }
Ejemplo n.º 6
0
        public override EEvaluationResult EvaluateEmpiricalRule(long[] premises)
        {
            EEvaluationResult eevaluationResult = this.operand.EvaluateEmpiricalRule(premises);

            if (eevaluationResult == EEvaluationResult.VALID)
            {
                return(EEvaluationResult.INVALID);
            }
            if (eevaluationResult == EEvaluationResult.INVALID)
            {
                return(EEvaluationResult.VALID);
            }
            return(eevaluationResult);
        }
Ejemplo n.º 7
0
        public override EEvaluationResult EvaluateVariantRule(ClientDefinition client, CharacteristicSet baseConfiguration, EcuConfiguration ecus)
        {
            bool flag = false;

            this.missingCharacteristics.Clear();
            this.missingVariants.Clear();
            EEvaluationResult result = EEvaluationResult.INVALID;

            foreach (RuleExpression ruleExpression in this.operands)
            {
                EEvaluationResult eevaluationResult = ruleExpression.EvaluateVariantRule(client, baseConfiguration, ecus);
                switch (eevaluationResult)
                {
                case EEvaluationResult.VALID:
                    this.missingCharacteristics.Clear();
                    this.missingVariants.Clear();
                    return(eevaluationResult);

                case EEvaluationResult.INVALID:
                    break;

                case EEvaluationResult.MISSING_CHARACTERISTIC:
                    this.missingCharacteristics.AddRange(ruleExpression.GetUnknownCharacteristics(baseConfiguration));
                    if (!flag)
                    {
                        flag   = true;
                        result = eevaluationResult;
                    }
                    break;

                case EEvaluationResult.MISSING_VARIANT:
                    this.missingVariants.AddRange(ruleExpression.GetUnknownVariantIds(ecus));
                    if (!flag)
                    {
                        flag   = true;
                        result = eevaluationResult;
                    }
                    break;

                default:
                    throw new Exception("Unknown result");
                }
            }
            return(result);
        }
Ejemplo n.º 8
0
 /// <summary>検証結果の追加
 /// </summary>
 /// <param name="result">検証結果</param>
 /// <param name="message">メッセージ</param>
 private void AddItem(EEvaluationResult result, string message)
 {
     AddItem(new CEvaluationItem(result, sdate, message));
 }