Ejemplo n.º 1
0
 /// <summary>
 ///
 /// </summary>
 public override void Simulate()
 {
     try
     {
         if (CurrentCrop != null)
         {
             if (UseLAIModel())
             {
                 if (CurrentCrop.GetInFallow())
                 {
                     TryAndPlantNewCrop();
                 }
                 else if (CurrentCrop.IsGrowing())
                 {
                     CurrentCrop.Simulate();
                 }
             }
             else
             {
                 CurrentCrop.Simulate();
             }
             ++DaysSinceHarvest;
             TotalTranspiration      = CurrentCrop.TotalTranspiration;
             TotalEvapotranspiration = CurrentCrop.TotalTranspiration + Sim.SoilController.SoilEvap;
             UpdateCropWaterBalanceParameters();
         }
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Ejemplo n.º 2
0
 /// <summary>
 ///
 /// </summary>
 public override void Simulate()
 {
     try
     {
         if (CurrentCrop != null)
         {
             if (UseLAIModel())
             {
                 if (CurrentCrop.GetInFallow())
                 {
                     TryAndPlantNewCrop();
                 }
                 else if (CurrentCrop.IsGrowing())
                 {
                     CurrentCrop.Simulate();
                 }
             }
             else
             {
                 CurrentCrop.Simulate();
             }
             ++days_since_harvest;
             total_transpiration      = CurrentCrop.total_transpiration;
             total_evapotranspiration = CurrentCrop.total_transpiration + sim.out_WatBal_SoilEvap_mm;
             UpdateCropWaterBalanceParameters();
         }
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 public bool InFallow()
 {
     if (CurrentCrop != null)
     {
         return(CurrentCrop.GetInFallow());
     }
     return(true);
 }
Ejemplo n.º 4
0
 internal bool InFallow()
 {
     try
     {
         if (CurrentCrop != null)
         {
             return(CurrentCrop.GetInFallow());
         }
     }
     catch (Exception ex)
     {
         throw ErrorLogger.CreateException(ex);
     }
     return(true);
 }
 public void TryModelVegetation()
 {
     try
     {
         if (VegetationModules != null)
         {
             if (CurrentCrop != null)
             {
                 if (UseLAIModel())
                 {
                     if (CurrentCrop.GetInFallow())
                     {
                         foreach (var crop in SortedVegetationModules)
                         {
                             if (CanPlantCrop(crop))
                             {
                                 crop.Plant();
                                 if (IrrigationModule != null)
                                 {
                                     IrrigationModule.FirstIrrigation = true;
                                 }
                                 return;
                             }
                         }
                     }
                     else if (CurrentCrop.IsGrowing())
                     {
                         CurrentCrop.Simulate();
                     }
                 }
                 else
                 {
                     CurrentCrop.Simulate();
                 }
                 ++DaysSinceHarvest;
                 TotalTranspiration      = CurrentCrop.TotalTranspiration;
                 TotalEvapotranspiration = CurrentCrop.TotalTranspiration + SoilModule.SoilEvap;
                 //UpdateCropWaterBalanceParameters();
             }
         }
     }
     catch (Exception ex)
     {
         throw ErrorLogger.CreateException(ex);
     }
 }