示例#1
0
        public static void randomDeltaSoilN()
        {
            decimal[] clayRange = new decimal[12] {
                3.6m, 3.6m, 6.4m, 7.2m, 12.2m, 12m, 17.4m, 20m, 50m, 20m, 7.5m, 7.5m
            };
            System.Random RandNum  = new System.Random();
            DeltaSoilN    instanec = new DeltaSoilN();
            int           SoilCode;
            int           FarmType;
            int           PostalCode;
            decimal       TotalCarbonFromCrops;
            decimal       TotalCarbonFromManure;
            decimal       FractionCatchCrops;
            decimal       Clay;

            instanec.print();
            for (int i = 0; i < 10000; i++)
            {
                SoilCode              = RandNum.Next(1, 12);
                FarmType              = RandNum.Next(1, 3);
                PostalCode            = RandNum.Next(1000, 9900);
                TotalCarbonFromCrops  = (decimal)RandNum.NextDouble() * (7);
                TotalCarbonFromManure = (decimal)RandNum.NextDouble() * (5);
                FractionCatchCrops    = (decimal)RandNum.NextDouble() * (1);
                Clay = clayRange[SoilCode - 1];
                instanec.init(SoilCode, FarmType, PostalCode, TotalCarbonFromCrops, TotalCarbonFromManure, FractionCatchCrops, Clay);
            }
            instanec.close();
        }
示例#2
0
        public static void systematicDeltaSoilN()
        {
            decimal[] clayRange = new decimal[12] {
                3.6m, 3.6m, 6.4m, 7.2m, 12.2m, 12m, 17.4m, 20m, 50m, 20m, 7.5m, 7.5m
            };
            DeltaSoilN instanec = new DeltaSoilN();

            instanec.print();
            for (int i = 0; i < 12; i++)
            {
                instanec.init(i, 2, 5000, 3.5m, 2.5m, 0.5m, clayRange[i]);
            }
            instanec.print();
            for (int i = 1; i < 4; i++)
            {
                instanec.init(6, i, 5000, 3.5m, 2.5m, 0.5m, clayRange[5]);
            }
            instanec.print();
            for (int i = 1000; i < 9990; i = i + 90)
            {
                instanec.init(6, 1, i, 3.5m, 2.5m, 0.5m, clayRange[5]);
            }
            instanec.print();
            for (int i = 0; i < 101; i = i + 1)
            {
                instanec.init(6, 1, 5000, i * 0.07m, 2.5m, 0.5m, clayRange[5]);
            }
            instanec.print();
            for (int i = 0; i < 101; i = i + 1)
            {
                instanec.init(6, 1, 5000, 3.5m, i * 0.05m, 0.5m, clayRange[5]);
            }
            instanec.print();
            for (int i = 0; i < 101; i = i + 1)
            {
                instanec.init(6, 1, 5000, 3.5m, 2.5m, i * 0.01m, clayRange[5]);
            }
            instanec.close();
        }