コード例 #1
0
ファイル: Node.cs プロジェクト: ArthurJS/SampleDotNet
        public override List <Boolean> GetDeterminationPath(Climatogram climatogram, List <Boolean> blist)
        {
            double valPar1 = Par1.Execute(climatogram);

            if (HasValue)
            {
                if (Operator.Execute(valPar1, (double)Value))
                {
                    blist.Add(true);
                    return(YesNode.GetDeterminationPath(climatogram, blist));
                }
                else
                {
                    blist.Add(false);
                    return(NoNode.GetDeterminationPath(climatogram, blist));
                }
            }
            else
            {
                double valPar2 = Par2.Execute(climatogram);
                if (Operator.Execute(valPar1, valPar2))
                {
                    blist.Add(true);
                    return(YesNode.GetDeterminationPath(climatogram, blist));
                }
                else
                {
                    blist.Add(false);
                    return(NoNode.GetDeterminationPath(climatogram, blist));
                }
            }
        }
コード例 #2
0
ファイル: Node.cs プロジェクト: ArthurJS/SampleDotNet
        public override string[] Determineer(Climatogram climatogram)
        {
            double valPar1 = Par1.Execute(climatogram);

            if (HasValue)
            {
                if (Operator.Execute(valPar1, (double)Value))
                {
                    return(YesNode.Determineer(climatogram));
                }
                else
                {
                    return(NoNode.Determineer(climatogram));
                }
            }
            else
            {
                double valPar2 = Par2.Execute(climatogram);
                if (Operator.Execute(valPar1, valPar2))
                {
                    return(YesNode.Determineer(climatogram));
                }
                else
                {
                    return(NoNode.Determineer(climatogram));
                }
            }
        }