예제 #1
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));
                }
            }
        }
예제 #2
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));
                }
            }
        }
예제 #3
0
        public override double Execute(Climatogram climatogram)
        {
            int aantal = 0;
            ICollection <double> temperaturen = climatogram.Temperatures;

            foreach (double temp in temperaturen.Where(temp => (temp >= 10)))
            {
                aantal++;
            }

            return(aantal);
        }
예제 #4
0
        public Vragenlijst(Location location, Climatogram climatogram)
        {
            string[] Vragen =
            {
                "Wat is de warmste maand?",
                "Wat is de temperatuur van de warmste maand (Tw)?",
                "Wat is de koudste maand?",
                "Wat is de temperatuur van de koudste maand (Tk)?",
                "Hoeveel droge maanden zijn er (D)?",
                "Hoeveel neerslag is er in de zomer?",
                "Hoeveel neerslag is er in de winter?"
            };
            TemperatureData     = location.Climatogram.MonthlyDataList.Select(m => m.Temperature).ToArray();
            NeerslagZomer       = location.Climatogram.GetPercipitation(location.CalculateSituated(), true);
            NeerslagWinter      = location.Climatogram.GetPercipitation(location.CalculateSituated(), false);
            NeerslagWinterZomer = new double[] { NeerslagZomer - 10, NeerslagZomer, NeerslagWinter + 10, NeerslagWinter };
            AantalMaanden       = new double[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12 };
            double[] Maanden =
            { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12
              //new SelectListItem{ Value = "1", Text="Januari"},
              //new SelectListItem{ Value = "2", Text="Februari"},
              //new SelectListItem{ Value = "3", Text="Maart"},
              //new SelectListItem{ Value = "4", Text="April"},
              //new SelectListItem{ Value = "5", Text="Mei"},
              //new SelectListItem{ Value = "6", Text="Juni"},
              //new SelectListItem{ Value = "7", Text="Juli"},
              //new SelectListItem{ Value = "8", Text="Augustus"},
              //new SelectListItem{ Value = "9", Text="September"},
              //new SelectListItem{ Value = "10", Text="Oktober"},
              //new SelectListItem{ Value = "11", Text="November"},
              //new SelectListItem{ Value = "12", Text="December"},
            };

            Parameters = new List <AbstractParameter>();
            Parameters.Add(new HottestMonth());
            Parameters.Add(new Tw());
            Parameters.Add(new ColdestMonth());
            Parameters.Add(new Tk());
            Parameters.Add(new DryMonths());
            Parameters.Add(new PrecipitationSummer(location));
            Parameters.Add(new PrecipitationWinter(location));

            VragenLijst = new List <Vraag>();
            VragenLijst.Add(new Vraag(Vragen[0], Parameters[0].Execute(climatogram), Maanden));
            VragenLijst.Add(new Vraag(Vragen[1], Parameters[1].Execute(climatogram), TemperatureData));
            VragenLijst.Add(new Vraag(Vragen[2], Parameters[2].Execute(climatogram), Maanden));
            VragenLijst.Add(new Vraag(Vragen[3], Parameters[3].Execute(climatogram), TemperatureData));
            VragenLijst.Add(new Vraag(Vragen[4], Parameters[4].Execute(climatogram), AantalMaanden));
            VragenLijst.Add(new Vraag(Vragen[5], Parameters[5].Execute(climatogram), NeerslagWinterZomer));
            VragenLijst.Add(new Vraag(Vragen[6], Parameters[6].Execute(climatogram), NeerslagWinterZomer));
        }
예제 #5
0
 public override double Execute(Climatogram climatogram)
 {
     return(climatogram.GetPercipitation(Situated, true));
 }
예제 #6
0
파일: Nm.cs 프로젝트: ArthurJS/SampleDotNet
        public override double Execute(Climatogram climatogram)
        {
            double waarde = climatogram.Percipitations.Sum() / 12;

            return(waarde);
        }
예제 #7
0
 public override double Execute(Climatogram climatogram)
 {
     return(climatogram.NumberOfDryMonths);
 }
예제 #8
0
파일: Nj.cs 프로젝트: ArthurJS/SampleDotNet
 public override double Execute(Climatogram climatogram)
 {
     return(climatogram.PY);
 }
예제 #9
0
 public abstract List <Boolean> GetDeterminationPath(Climatogram climatogram, List <Boolean> blist);
예제 #10
0
 public abstract string[] Determineer(Climatogram climatogram);
예제 #11
0
 public override double Execute(Climatogram climatogram)
 {
     return(climatogram.ColdestMonth);
 }
예제 #12
0
 public abstract double Execute(Climatogram climatogram);
예제 #13
0
 public override List <Boolean> GetDeterminationPath(Climatogram climatogram, List <Boolean> blist)
 {
     return(blist);
 }
예제 #14
0
 public override string[] Determineer(Climatogram climatogram)
 {
     return(new[] { Klimaattype, Vegetatietype, Imagepath });
 }
예제 #15
0
 public override double Execute(Climatogram climatogram)
 {
     return(climatogram.TmBiggerOrEqualThan10);
 }