Exemplo n.º 1
0
        /// <summary>
        /// Calculate how much to irrigate in a Date.
        /// Use both ways to calculate: by available water and by acumulated evapotranspirationCrop
        /// </summary>
        /// <param name="pName">new name</param>
        public Pair <double, Utils.WaterInputType> HowMuchToIrrigate(CropIrrigationWeather pCropIrrigationWeather)
        {
            Pair <double, Utils.WaterInputType> lReturn;
            bool   lIrrigationByEvapotranspiration;
            bool   lIrrigationByHydricBalance;
            double lPercentageAvailableWater;

            lReturn = new Pair <double, Utils.WaterInputType>();
            lIrrigationByEvapotranspiration = CalculusEvapotranspiration.IrrigateByEvapotranspiration(pCropIrrigationWeather);
            lIrrigationByHydricBalance      = CalculusAvailableWater.IrrigateByHydricBalance(pCropIrrigationWeather);
            lPercentageAvailableWater       = pCropIrrigationWeather.GetPercentageOfAvailableWaterTakingIntoAccointPermanentWiltingPoint();

            //If we need to irrigate by Evapotranspiraton, then Available water has to be lower than 60%
            if (lIrrigationByEvapotranspiration && lPercentageAvailableWater < InitialTables.PERCENTAGE_OF_AVAILABE_WATER_TO_IRRIGATE)
            {
                lReturn.First  = pCropIrrigationWeather.PredeterminatedIrrigationQuantity;
                lReturn.Second = Utils.WaterInputType.IrrigationByETCAcumulated;
            }
            else if (lIrrigationByHydricBalance)
            {
                lReturn.First  = pCropIrrigationWeather.PredeterminatedIrrigationQuantity;
                lReturn.Second = Utils.WaterInputType.IrrigationByHydricBalance;
            }

            return(lReturn);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Constructor of ClassTemplate
 /// </summary>
 public IrrigationCalculus()
 {
     this.calculusAvailableWater     = new CalculusAvailableWater();
     this.calculusEvapotranspiration = new CalculusEvapotranspiration();
 }