예제 #1
0
        public static void exelTestNLess()
        {
            N_LES instance = new N_LES();

            instance.print();

            instance.init(183, (decimal)166, (decimal)0, (decimal)2, (decimal)0, 120, 2007, 3, (decimal)7.1, (decimal)6.9, (decimal)45.417, (decimal)45.417, 0, 0);

            instance.print();

            instance.init(183, (decimal)166, (decimal)0, (decimal)2, (decimal)0, 120, 2007, 2, 4m, 4.9m, (decimal)51.7003, (decimal)51.7003, (decimal)(-7.6), 0);
            instance.print();

            instance.init(183, (decimal)166, (decimal)0, (decimal)2, (decimal)0, 120, 2007, 3, 7.1m, 6.9m, (decimal)44.2059, (decimal)44.2059, (decimal)(-7.6), 0);
            instance.print();

            instance.init(183, (decimal)166, (decimal)0, (decimal)2, (decimal)0, 120, 2007, 4, 9.7m, 7.6m, (decimal)42.0424, (decimal)42.0424, (decimal)(-7.6), 0);
            instance.print();

            instance.init(183, (decimal)166, (decimal)0, (decimal)2, (decimal)0, 120, 2007, 5, 12.2m, 12.1m, (decimal)36.2735, (decimal)36.2735, (decimal)(-7.6), 0);
            instance.print();

            instance.init(183, (decimal)166, (decimal)0, (decimal)2, (decimal)0, 120, 2007, 6, 13.3m, 12.3m, (decimal)35.8916, (decimal)35.8916, (decimal)(-7.6), 0);
            instance.print();

            instance.init(183, (decimal)166, (decimal)0, (decimal)2, (decimal)0, 120, 2007, 7, 14.4m, 17.8m, (decimal)39.777, (decimal)39.7777, (decimal)(-7.6), 0);
            instance.print();

            instance.init(183, (decimal)166, (decimal)0, (decimal)2, (decimal)0, 120, 2007, 1, 3.4m, 3.6m, (decimal)38.7943, (decimal)38.7943, (decimal)(-7.6), 0);
            instance.close();
        }
예제 #2
0
        public static void randomTestNless()
        {
            System.Random RandNum  = new System.Random();
            N_LES         instance = new N_LES();

            instance.print();
            decimal N_Niveau;
            decimal N_Spring;
            decimal N_Fall;
            decimal N_Fix;
            decimal N_GrazingManure;
            decimal N_Removed;
            int     Year;
            int     SoilType;
            decimal Humus;
            decimal Clay;
            decimal Run_Off1;
            decimal Run_Off2;

            decimal[] CrpCoeffValues     = { (decimal)(-165.7), (decimal)(-98.6), -42, (decimal)(-7.6), 0, (decimal)28.8 };;
            decimal[] PreCropCoeffValues = { (decimal)(37.7), (decimal)(14.2), 0, (decimal)(-38.5) };
            decimal   CropCoeff;
            decimal   PreCropCoeff;

            for (int i = 0; i < 10000; i++)
            {
                N_Niveau        = (decimal)RandNum.NextDouble() * (2);
                N_Spring        = (decimal)RandNum.NextDouble() * (300);
                N_Fall          = (decimal)RandNum.NextDouble() * (150);
                N_Fix           = (decimal)RandNum.NextDouble() * (300);
                N_GrazingManure = (decimal)RandNum.NextDouble() * (200);
                N_Removed       = (decimal)RandNum.NextDouble() * (250);
                Year            = RandNum.Next(1963, 2063);
                SoilType        = RandNum.Next(1, 12);
                Humus           = (decimal)(RandNum.NextDouble() * (0.5));
                Clay            = (decimal)(RandNum.NextDouble() * (0.7));
                Run_Off1        = (decimal)(50 + RandNum.NextDouble() * (650));
                Run_Off2        = (decimal)(50 + RandNum.NextDouble() * (650));


                CropCoeff = CrpCoeffValues[RandNum.Next(0, 5)];

                PreCropCoeff = PreCropCoeffValues[RandNum.Next(0, 3)];
                instance.init(N_Niveau, N_Spring, N_Fall, N_Fix, N_GrazingManure, N_Removed, Year, SoilType, Humus, Clay, Run_Off1, Run_Off2, CropCoeff, PreCropCoeff);
            }
            instance.close();
        }