Exemple #1
0
 /// <summary>Add any replacements to all simulation descriptions.</summary>
 /// <param name="simulations">The top level simulations model.</param>
 private void AddReplacements(Simulations simulations)
 {
     if (simulations != null)
     {
         IModel replacements = Apsim.Child(simulations, "Replacements");
         if (replacements != null)
         {
             foreach (IModel replacement in replacements.Children)
             {
                 var modelReplacement = new ModelReplacement(null, replacement);
                 replacementsToApply.Insert(0, modelReplacement);
             }
         }
     }
 }
Exemple #2
0
 /// <summary>Add any replacements to all simulation descriptions.</summary>
 private void AddReplacements()
 {
     if (topLevelModel != null)
     {
         IModel replacements = Apsim.Child(topLevelModel, typeof(Replacements));
         if (replacements != null)
         {
             foreach (IModel replacement in replacements.Children)
             {
                 var modelReplacement = new ModelReplacement(null, replacement);
                 replacementsToApply.Insert(0, modelReplacement);
             }
         }
     }
 }
Exemple #3
0
 /// <summary>Add any replacements to all simulation descriptions.</summary>
 private void AddReplacements()
 {
     if (topLevelModel != null)
     {
         IModel replacements = topLevelModel.FindChild <Replacements>();
         if (replacements != null && replacements.Enabled)
         {
             foreach (IModel replacement in replacements.Children)
             {
                 var modelReplacement = new ModelReplacement(null, replacement);
                 replacementsToApply.Insert(0, modelReplacement);
             }
         }
     }
 }