/// <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);
     }
 }
Exemple #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);
     }
 }
 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);
     }
 }