コード例 #1
0
        private Judgment GetFactor5()
        {
            Judgment judgment;

            judgment = new Judgment(FactorName.ConnectedDevices, EvaluationValue.NotEmpty);

            return(judgment);
        }
コード例 #2
0
        private Judgment GetFactor6()
        {
            Judgment judgment;

            judgment = new Judgment(FactorName.FlapPosition, EvaluationValue.Open);

            return(judgment);
        }
コード例 #3
0
        private Judgment GetFactor4()
        {
            Judgment judgment;

            judgment = new Judgment(FactorName.FuelInCan, EvaluationValue.Empty);

            return(judgment);
        }
コード例 #4
0
        private Judgment GetFactor1()
        {
            Judgment judgment;

            judgment = new Judgment(FactorName.OilInTank, EvaluationValue.Empty);

            return(judgment);
        }
コード例 #5
0
        private Judgment GetFactor7()
        {
            Judgment judgment;

            judgment = new Judgment(FactorName.AmbientTemperature, EvaluationValue.Hight);

            return(judgment);
        }
コード例 #6
0
        public void Print()
        {
            Console.WriteLine("————————————————————————————————————————");
            Console.WriteLine("Правило");
            Console.WriteLine("————————————————————————————————————————");
            Console.WriteLine("Aнтецедент(-ы):");

            IEnumerator <Judgment> antecedentJudgments = this.antecedent.JudgmentList.GetEnumerator();

            while (antecedentJudgments.MoveNext())
            {
                Judgment antecedentJudgment = antecedentJudgments.Current;
                antecedentJudgment.Print();
            }

            Console.WriteLine("Консеквент:");
            this.consequent.Judgment.Print();
            Console.WriteLine("————————————————————————————————————————\n\n");
        }
コード例 #7
0
        public override bool Equals(object obj)
        {
            if (obj is Judgment)
            {
                Judgment judgment = obj as Judgment;

                if (this.name == judgment.name &&
                    this.value == judgment.value)
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                throw new ArgumentException();
            }
        }
コード例 #8
0
 public Antecedent(Judgment judgment)
 {
     this.judgmentList = new List <Judgment> {
         judgment
     };
 }
コード例 #9
0
 public Consequent(Judgment judgment)
 {
     this.judgment = judgment;
 }