Пример #1
0
        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
        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));
                }
            }
        }