コード例 #1
0
 public string TestPostConditions(SiriusQualityPhenology.DomainClass.PhenologyState s,SiriusQualityPhenology.DomainClass.PhenologyState s1,SiriusQualityPhenology.DomainClass.PhenologyRate r,SiriusQualityPhenology.DomainClass.PhenologyAuxiliary a,SiriusQualityPhenology.DomainClass.PhenologyExogenous ex,string callID)
 {
     try
     {
         //Set current values of the outputs to the static VarInfo representing the output properties of the domain classes
         SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.averageShootNumberPerPlant.CurrentValue=s.averageShootNumberPerPlant;
         SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.canopyShootNumber.CurrentValue=s.canopyShootNumber;
         SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.leafTillerNumberArray.CurrentValue=s.leafTillerNumberArray;
         SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.tilleringProfile.CurrentValue=s.tilleringProfile;
         SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.numberTillerCohort.CurrentValue=s.numberTillerCohort;
         ConditionsCollection prc = new ConditionsCollection();
         Preconditions pre = new Preconditions(); 
         RangeBasedCondition r8 = new RangeBasedCondition(SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.averageShootNumberPerPlant);
         if(r8.ApplicableVarInfoValueTypes.Contains( SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.averageShootNumberPerPlant.ValueType)){prc.AddCondition(r8);}
         RangeBasedCondition r9 = new RangeBasedCondition(SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.canopyShootNumber);
         if(r9.ApplicableVarInfoValueTypes.Contains( SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.canopyShootNumber.ValueType)){prc.AddCondition(r9);}
         RangeBasedCondition r10 = new RangeBasedCondition(SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.leafTillerNumberArray);
         if(r10.ApplicableVarInfoValueTypes.Contains( SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.leafTillerNumberArray.ValueType)){prc.AddCondition(r10);}
         RangeBasedCondition r11 = new RangeBasedCondition(SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.tilleringProfile);
         if(r11.ApplicableVarInfoValueTypes.Contains( SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.tilleringProfile.ValueType)){prc.AddCondition(r11);}
         RangeBasedCondition r12 = new RangeBasedCondition(SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.numberTillerCohort);
         if(r12.ApplicableVarInfoValueTypes.Contains( SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.numberTillerCohort.ValueType)){prc.AddCondition(r12);}
         string postConditionsResult = pre.VerifyPostconditions(prc, callID); if (!string.IsNullOrEmpty(postConditionsResult)) { pre.TestsOut(postConditionsResult, true, "PostConditions errors in strategy " + this.GetType().Name); } return postConditionsResult;
     }
     catch (Exception exception)
     {
         string msg = "SiriusQuality.Phenology, " + this.GetType().Name + ": Unhandled exception running post-condition test. ";
         throw new Exception(msg, exception);
     }
 }
コード例 #2
0
 public string TestPostConditions(Phenology.DomainClass.PhenologyState s, Phenology.DomainClass.PhenologyState s1, Phenology.DomainClass.PhenologyRate r, Phenology.DomainClass.PhenologyAuxiliary a, Phenology.DomainClass.PhenologyExogenous ex, string callID)
 {
     try
     {
         //Set current values of the outputs to the static VarInfo representing the output properties of the domain classes
         Phenology.DomainClass.PhenologyStateVarInfo.phyllochron.CurrentValue = s.phyllochron;
         ConditionsCollection prc = new ConditionsCollection();
         Preconditions        pre = new Preconditions();
         RangeBasedCondition  r20 = new RangeBasedCondition(Phenology.DomainClass.PhenologyStateVarInfo.phyllochron);
         if (r20.ApplicableVarInfoValueTypes.Contains(Phenology.DomainClass.PhenologyStateVarInfo.phyllochron.ValueType))
         {
             prc.AddCondition(r20);
         }
         string postConditionsResult = pre.VerifyPostconditions(prc, callID); if (!string.IsNullOrEmpty(postConditionsResult))
         {
             pre.TestsOut(postConditionsResult, true, "PostConditions errors in strategy " + this.GetType().Name);
         }
         return(postConditionsResult);
     }
     catch (Exception exception)
     {
         string msg = ".Phenology, " + this.GetType().Name + ": Unhandled exception running post-condition test. ";
         throw new Exception(msg, exception);
     }
 }
コード例 #3
0
 public string TestPostConditions(SiriusQualityEnergybalance.DomainClass.EnergybalanceState s, SiriusQualityEnergybalance.DomainClass.EnergybalanceState s1, SiriusQualityEnergybalance.DomainClass.EnergybalanceRate r, SiriusQualityEnergybalance.DomainClass.EnergybalanceAuxiliary a, SiriusQualityEnergybalance.DomainClass.EnergybalanceExogenous ex, string callID)
 {
     try
     {
         //Set current values of the outputs to the static VarInfo representing the output properties of the domain classes
         SiriusQualityEnergybalance.DomainClass.EnergybalanceAuxiliaryVarInfo.netRadiation.CurrentValue = a.netRadiation;
         SiriusQualityEnergybalance.DomainClass.EnergybalanceAuxiliaryVarInfo.netOutGoingLongWaveRadiation.CurrentValue = a.netOutGoingLongWaveRadiation;
         ConditionsCollection prc = new ConditionsCollection();
         Preconditions        pre = new Preconditions();
         RangeBasedCondition  r9  = new RangeBasedCondition(SiriusQualityEnergybalance.DomainClass.EnergybalanceStateVarInfo.netRadiation);
         if (r9.ApplicableVarInfoValueTypes.Contains(SiriusQualityEnergybalance.DomainClass.EnergybalanceAuxiliaryVarInfo.netRadiation.ValueType))
         {
             prc.AddCondition(r9);
         }
         RangeBasedCondition r10 = new RangeBasedCondition(SiriusQualityEnergybalance.DomainClass.EnergybalanceStateVarInfo.netOutGoingLongWaveRadiation);
         if (r10.ApplicableVarInfoValueTypes.Contains(SiriusQualityEnergybalance.DomainClass.EnergybalanceAuxiliaryVarInfo.netOutGoingLongWaveRadiation.ValueType))
         {
             prc.AddCondition(r10);
         }
         string postConditionsResult = pre.VerifyPostconditions(prc, callID); if (!string.IsNullOrEmpty(postConditionsResult))
         {
             pre.TestsOut(postConditionsResult, true, "PostConditions errors in strategy " + this.GetType().Name);
         }
         return(postConditionsResult);
     }
     catch (Exception exception)
     {
         string msg = "SiriusQuality.Energybalance, " + this.GetType().Name + ": Unhandled exception running post-condition test. ";
         throw new Exception(msg, exception);
     }
 }
コード例 #4
0
 public string TestPostConditions(SiriusQualitySnow.DomainClass.SnowState s, SiriusQualitySnow.DomainClass.SnowState s1, SiriusQualitySnow.DomainClass.SnowRate r, SiriusQualitySnow.DomainClass.SnowAuxiliary a, SiriusQualitySnow.DomainClass.SnowExogenous ex, string callID)
 {
     try
     {
         //Set current values of the outputs to the static VarInfo representing the output properties of the domain classes
         SiriusQualitySnow.DomainClass.SnowStateVarInfo.Sdepth_cm.CurrentValue = s.Sdepth_cm;
         ConditionsCollection prc = new ConditionsCollection();
         Preconditions        pre = new Preconditions();
         RangeBasedCondition  r3  = new RangeBasedCondition(SiriusQualitySnow.DomainClass.SnowStateVarInfo.Sdepth_cm);
         if (r3.ApplicableVarInfoValueTypes.Contains(SiriusQualitySnow.DomainClass.SnowStateVarInfo.Sdepth_cm.ValueType))
         {
             prc.AddCondition(r3);
         }
         string postConditionsResult = pre.VerifyPostconditions(prc, callID); if (!string.IsNullOrEmpty(postConditionsResult))
         {
             pre.TestsOut(postConditionsResult, true, "PostConditions errors in strategy " + this.GetType().Name);
         }
         return(postConditionsResult);
     }
     catch (Exception exception)
     {
         string msg = "SiriusQuality.Snow, " + this.GetType().Name + ": Unhandled exception running post-condition test. ";
         throw new Exception(msg, exception);
     }
 }
コード例 #5
0
        //Parameters static VarInfo list of the composite class


        #endregion

        #region pre/post conditions management

        /// <summary>
        /// Test to verify the postconditions
        /// </summary>
        public string TestPostConditions(SiriusQualityPhenology.PhenologyState phenologystate, SiriusQualityPhenology.PhenologyState phenologystate1, string callID)
        {
            try
            {
                //Set current values of the outputs to the static VarInfo representing the output properties of the domain classes

                SiriusQualityPhenology.PhenologyStateVarInfo.hasZadokStageChanged.CurrentValue = phenologystate.hasZadokStageChanged;
                SiriusQualityPhenology.PhenologyStateVarInfo.currentZadokStage.CurrentValue    = phenologystate.currentZadokStage;
                SiriusQualityPhenology.PhenologyStateVarInfo.Calendar.CurrentValue             = phenologystate.Calendar;

                //Create the collection of the conditions to test
                ConditionsCollection prc = new ConditionsCollection();
                Preconditions        pre = new Preconditions();


                RangeBasedCondition r7 = new RangeBasedCondition(SiriusQualityPhenology.PhenologyStateVarInfo.hasZadokStageChanged);
                if (r7.ApplicableVarInfoValueTypes.Contains(SiriusQualityPhenology.PhenologyStateVarInfo.hasZadokStageChanged.ValueType))
                {
                    prc.AddCondition(r7);
                }
                RangeBasedCondition r8 = new RangeBasedCondition(SiriusQualityPhenology.PhenologyStateVarInfo.currentZadokStage);
                if (r8.ApplicableVarInfoValueTypes.Contains(SiriusQualityPhenology.PhenologyStateVarInfo.currentZadokStage.ValueType))
                {
                    prc.AddCondition(r8);
                }
                RangeBasedCondition r9 = new RangeBasedCondition(SiriusQualityPhenology.PhenologyStateVarInfo.Calendar);
                if (r9.ApplicableVarInfoValueTypes.Contains(SiriusQualityPhenology.PhenologyStateVarInfo.Calendar.ValueType))
                {
                    prc.AddCondition(r9);
                }



                //GENERATED CODE END - PLACE YOUR CUSTOM CODE BELOW - Section4
                //Code written below will not be overwritten by a future code generation



                //End of custom code. Do not place your custom code below. It will be overwritten by a future code generation.
                //PLACE YOUR CUSTOM CODE ABOVE - GENERATED CODE START - Section4

                //Get the evaluation of postconditions
                string postConditionsResult = pre.VerifyPostconditions(prc, callID);
                //if we have errors, send it to the configured output
                if (!string.IsNullOrEmpty(postConditionsResult))
                {
                    pre.TestsOut(postConditionsResult, true, "PostConditions errors in component SiriusQualityPhenology.Strategies, strategy " + this.GetType().Name);
                }
                return(postConditionsResult);
            }
            catch (Exception exception)
            {
                //Uncomment the next line to use the trace
                //TraceStrategies.TraceEvent(System.Diagnostics.TraceEventType.Error, 1001,	"Strategy: " + this.GetType().Name + " - Unhandled exception running post-conditions");

                string msg = "Component SiriusQualityPhenology.Strategies, " + this.GetType().Name + ": Unhandled exception running post-condition test. ";
                throw new Exception(msg, exception);
            }
        }
コード例 #6
0
        /// <summary>
        /// Test to verify the postconditions
        /// </summary>
        public string TestPostConditions(SiriusQualityEnergyBalance.EnergyBalanceState energybalancestate, string callID)
        {
            try
            {
                //Set current values of the outputs to the static VarInfo representing the output properties of the domain classes


                //Create the collection of the conditions to test
                ConditionsCollection prc = new ConditionsCollection();
                Preconditions        pre = new Preconditions();



                string ret = "";
                ret += _calculatenetradiation.TestPostConditions(energybalancestate, "strategy SiriusQualityEnergyBalance.CalculateNetRadiation");
                ret += _calculatediffusionlimitedevaporation.TestPostConditions(energybalancestate, "strategy SiriusQualityEnergyBalance.CalculateDiffusionLimitedEvaporation");
                ret += _calculatepriestlytaylor.TestPostConditions(energybalancestate, "strategy SiriusQualityEnergyBalance.CalculatePriestlyTaylor");
                ret += _calculateptsoil.TestPostConditions(energybalancestate, "strategy SiriusQualityEnergyBalance.CalculatePtSoil");
                ret += _calculateconductance.TestPostConditions(energybalancestate, "strategy SiriusQualityEnergyBalance.CalculateConductance");
                ret += _calculatepenman.TestPostConditions(energybalancestate, "strategy SiriusQualityEnergyBalance.CalculatePenman");
                ret += _calculatepottranspiration.TestPostConditions(energybalancestate, "strategy SiriusQualityEnergyBalance.CalculatePotTranspiration");
                ret += _calculatesoilevaporation.TestPostConditions(energybalancestate, "strategy SiriusQuailtyEnergyBalance.CalculateSoilEvaporation");
                ret += _calculatesoilheatflux.TestPostConditions(energybalancestate, "strategy SiriusQualityEnergyBalance.CalculateSoilHeatFlux");
                ret += _calculatecropheatflux.TestPostConditions(energybalancestate, "strategy SiriusQualityEnergyBalance.CalculateCropHeatFlux");
                ret += _calculatecanopytemperature.TestPostConditions(energybalancestate, "strategy SiriusQualityEnergyBalance.CalculateCanopyTemperature");
                ret += _calculatecanopytemperaturemaize.TestPostConditions(energybalancestate, "strategy SiriusQualityEnergyBalance.CalculateCanopyTemperatureMaize");
                ret += _calculatevpdairleaf.TestPostConditions(energybalancestate, "strategy SiriusQualityEnergyBalance.Calculatevpdairleaf");
                ret += _calculatevpdeq.TestPostConditions(energybalancestate, "strategy SiriusQualityEnergyBalance.calculateVPDeq");
                if (ret != "")
                {
                    pre.TestsOut(ret, true, "   postconditions tests of associated classes");
                }

                //GENERATED CODE END - PLACE YOUR CUSTOM CODE BELOW - Section4
                //Code written below will not be overwritten by a future code generation



                //End of custom code. Do not place your custom code below. It will be overwritten by a future code generation.
                //PLACE YOUR CUSTOM CODE ABOVE - GENERATED CODE START - Section4

                //Get the evaluation of postconditions
                string postConditionsResult = pre.VerifyPostconditions(prc, callID);
                //if we have errors, send it to the configured output
                if (!string.IsNullOrEmpty(postConditionsResult))
                {
                    pre.TestsOut(postConditionsResult, true, "PostConditions errors in component SiriusQualityEnergyBalance, strategy " + this.GetType().Name);
                }
                return(postConditionsResult);
            }
            catch (Exception exception)
            {
                //Uncomment the next line to use the trace
                //TraceStrategies.TraceEvent(System.Diagnostics.TraceEventType.Error, 1001,	"Strategy: " + this.GetType().Name + " - Unhandled exception running post-conditions");

                string msg = "Component SiriusQualityEnergyBalance, " + this.GetType().Name + ": Unhandled exception running post-condition test. ";
                throw new Exception(msg, exception);
            }
        }
コード例 #7
0
        /// <summary>
        /// Test to verify the postconditions
        /// </summary>
        public string TestPostConditions(SiriusQualityMaizeLAI.MaizeLAIState maizelaistate, SiriusQualityMaizeLAI.MaizeLeafState maizeleafstate, SiriusQualityMaizeLAI.MaizeLeafState maizeleafstate1, string callID)
        {
            try
            {
                //Set current values of the outputs to the static VarInfo representing the output properties of the domain classes


                //Create the collection of the conditions to test
                ConditionsCollection prc = new ConditionsCollection();
                Preconditions        pre = new Preconditions();



                string ret = "";
                ret += _calcbasewidth.TestPostConditions(maizelaistate, maizeleafstate, maizeleafstate1, "strategy SiriusQualityMaizeLAI.Strategies.calcBaseWidth");
                ret += _calcfracpopn.TestPostConditions(maizelaistate, maizeleafstate, maizeleafstate1, "strategy SiriusQualityMaizeLAI.Strategies.calcFracPopn");
                ret += _calcfullyexptt.TestPostConditions(maizelaistate, maizeleafstate, maizeleafstate1, "strategy SiriusQualityMaizeLAI.Strategies.calcFullyExpTT");
                ret += _calcinittt.TestPostConditions(maizelaistate, maizeleafstate, maizeleafstate1, "strategy SiriusQualityMaizeLAI.Strategies.calcInitTT");
                ret += _calcler.TestPostConditions(maizelaistate, maizeleafstate, maizeleafstate1, "strategy SiriusQualityMaizeLAI.Strategies.calcLER");
                ret += _calclercoeff.TestPostConditions(maizelaistate, maizeleafstate, maizeleafstate1, "strategy SiriusQualityMaizeLAI.Strategies.calcLERCoeff");
                ret += _calcligulett.TestPostConditions(maizelaistate, maizeleafstate, maizeleafstate1, "strategy SiriusQualityMaizeLAI.Strategies.calcLiguleTT");
                ret += _calcstartenlargett.TestPostConditions(maizelaistate, maizeleafstate, maizeleafstate1, "strategy SiriusQualityMaizeLAI.Strategies.calcStartEnlargeTT");
                ret += _calcstartexptt.TestPostConditions(maizelaistate, maizeleafstate, maizeleafstate1, "strategy SiriusQualityMaizeLAI.Strategies.calcStartExpTT");
                ret += _calcstopenlargett.TestPostConditions(maizelaistate, maizeleafstate, maizeleafstate1, "strategy SiriusQualityMaizeLAI.Strategies.calcStopEnlargeTT");
                ret += _calctiptt.TestPostConditions(maizelaistate, maizeleafstate, maizeleafstate1, "strategy SiriusQualityMaizeLAI.Strategies.calcTipTT");
                ret += _deltalaimaize.TestPostConditions(maizelaistate, maizeleafstate, maizeleafstate1, "strategy SiriusQualityMaizeLAI.Strategies.DeltaLAIMaize");
                ret += _updateleafarea.TestPostConditions(maizelaistate, maizeleafstate, maizeleafstate1, "strategy SiriusQualityMaizeLAI.Strategies.UpdateLeafArea");
                if (ret != "")
                {
                    pre.TestsOut(ret, true, "   postconditions tests of associated classes");
                }

                //GENERATED CODE END - PLACE YOUR CUSTOM CODE BELOW - Section4
                //Code written below will not be overwritten by a future code generation



                //End of custom code. Do not place your custom code below. It will be overwritten by a future code generation.
                //PLACE YOUR CUSTOM CODE ABOVE - GENERATED CODE START - Section4

                //Get the evaluation of postconditions
                string postConditionsResult = pre.VerifyPostconditions(prc, callID);
                //if we have errors, send it to the configured output
                if (!string.IsNullOrEmpty(postConditionsResult))
                {
                    pre.TestsOut(postConditionsResult, true, "PostConditions errors in component SiriusQualityMaizeLAI.Strategies, strategy " + this.GetType().Name);
                }
                return(postConditionsResult);
            }
            catch (Exception exception)
            {
                //Uncomment the next line to use the trace
                //TraceStrategies.TraceEvent(System.Diagnostics.TraceEventType.Error, 1001,	"Strategy: " + this.GetType().Name + " - Unhandled exception running post-conditions");

                string msg = "Component SiriusQualityMaizeLAI.Strategies, " + this.GetType().Name + ": Unhandled exception running post-condition test. ";
                throw new Exception(msg, exception);
            }
        }
コード例 #8
0
        //Parameters static VarInfo list


        //Parameters static VarInfo list of the composite class


        #endregion

        #region pre/post conditions management

        /// <summary>
        /// Test to verify the postconditions
        /// </summary>
        public string TestPostConditions(INRA.SiriusQualityIrradiance.Interfaces.Rates rates, INRA.SiriusQualityIrradiance.Interfaces.Exogenous exogenous, INRA.SiriusQualityIrradiance.Interfaces.States states, string callID)
        {
            try
            {
                //Set current values of the outputs to the static VarInfo representing the output properties of the domain classes

                INRA.SiriusQualityIrradiance.Interfaces.RatesVarInfo.absorbedShadedIrradiance.CurrentValue = rates.absorbedShadedIrradiance;
                INRA.SiriusQualityIrradiance.Interfaces.RatesVarInfo.absorbedSunlitIrradiance.CurrentValue = rates.absorbedSunlitIrradiance;

                //Create the collection of the conditions to test
                ConditionsCollection prc = new ConditionsCollection();
                Preconditions        pre = new Preconditions();


                RangeBasedCondition r13 = new RangeBasedCondition(INRA.SiriusQualityIrradiance.Interfaces.RatesVarInfo.absorbedShadedIrradiance);
                if (r13.ApplicableVarInfoValueTypes.Contains(INRA.SiriusQualityIrradiance.Interfaces.RatesVarInfo.absorbedShadedIrradiance.ValueType))
                {
                    prc.AddCondition(r13);
                }
                RangeBasedCondition r14 = new RangeBasedCondition(INRA.SiriusQualityIrradiance.Interfaces.RatesVarInfo.absorbedSunlitIrradiance);
                if (r14.ApplicableVarInfoValueTypes.Contains(INRA.SiriusQualityIrradiance.Interfaces.RatesVarInfo.absorbedSunlitIrradiance.ValueType))
                {
                    prc.AddCondition(r14);
                }



                //GENERATED CODE END - PLACE YOUR CUSTOM CODE BELOW - Section4
                //Code written below will not be overwritten by a future code generation



                //End of custom code. Do not place your custom code below. It will be overwritten by a future code generation.
                //PLACE YOUR CUSTOM CODE ABOVE - GENERATED CODE START - Section4

                //Get the evaluation of postconditions
                string postConditionsResult = pre.VerifyPostconditions(prc, callID);
                //if we have errors, send it to the configured output
                if (!string.IsNullOrEmpty(postConditionsResult))
                {
                    pre.TestsOut(postConditionsResult, true, "PostConditions errors in component INRA.SiriusQualityIrradiance.Strategies, strategy " + this.GetType().Name);
                }
                return(postConditionsResult);
            }
            catch (Exception exception)
            {
                //Uncomment the next line to use the trace
                //TraceStrategies.TraceEvent(System.Diagnostics.TraceEventType.Error, 1001,	"Strategy: " + this.GetType().Name + " - Unhandled exception running post-conditions");

                string msg = "Component INRA.SiriusQualityIrradiance.Strategies, " + this.GetType().Name + ": Unhandled exception running post-condition test. ";
                throw new Exception(msg, exception);
            }
        }
コード例 #9
0
ファイル: Meteorology.cs プロジェクト: SiriusQuality/Release
        /// <summary>
        /// Test to verify the postconditions
        /// </summary>
        public string TestPostConditions(SiriusQualityMeteo.MeteoState meteostate, string callID)
        {
            try
            {
                //Set current values of the outputs to the static VarInfo representing the output properties of the domain classes


                //Create the collection of the conditions to test
                ConditionsCollection prc = new ConditionsCollection();
                Preconditions        pre = new Preconditions();



                string ret = "";
                ret += _calculatedailyvpd.TestPostConditions(meteostate, "strategy SiriusQualityMeteo.Strategies.CalculateDailyVPD");
                ret += _calculatehourlyairtemperature.TestPostConditions(meteostate, "strategy SiriusQualityMeteo.Strategies.CalculateHourlyAirTemperature");
                ret += _calculatehourlydirdifradiations.TestPostConditions(meteostate, "strategy SiriusQualityMeteo.Strategies.CalculateHourlyDirDifRadiations");
                ret += _calculatehourlyradiation.TestPostConditions(meteostate, "strategy SiriusQualityMeteo.Strategies.CalculateHourlyRadiation");
                ret += _calculatehourlyvpdair.TestPostConditions(meteostate, "strategy SiriusQualityMeteo.Strategies.calculateHourlyVPDAir");
                ret += _calculatehourlywindspeed.TestPostConditions(meteostate, "strategy SiriusQualityMeteo.Strategies.CalculateHourlyWindSpeed");
                ret += _calculateminmaxdailywindspeed.TestPostConditions(meteostate, "strategy SiriusQualityMeteo.Strategies.CalculateMinMaxDailyWindSpeed");
                ret += _calculatephotoperiod.TestPostConditions(meteostate, "strategy SiriusQualityMeteo.Strategies.CalculatePhotoperiod");
                if (ret != "")
                {
                    pre.TestsOut(ret, true, "   postconditions tests of associated classes");
                }

                //GENERATED CODE END - PLACE YOUR CUSTOM CODE BELOW - Section4
                //Code written below will not be overwritten by a future code generation



                //End of custom code. Do not place your custom code below. It will be overwritten by a future code generation.
                //PLACE YOUR CUSTOM CODE ABOVE - GENERATED CODE START - Section4

                //Get the evaluation of postconditions
                string postConditionsResult = pre.VerifyPostconditions(prc, callID);
                //if we have errors, send it to the configured output
                if (!string.IsNullOrEmpty(postConditionsResult))
                {
                    pre.TestsOut(postConditionsResult, true, "PostConditions errors in component SiriusQualityMeteo.Strategies, strategy " + this.GetType().Name);
                }
                return(postConditionsResult);
            }
            catch (Exception exception)
            {
                //Uncomment the next line to use the trace
                //TraceStrategies.TraceEvent(System.Diagnostics.TraceEventType.Error, 1001,	"Strategy: " + this.GetType().Name + " - Unhandled exception running post-conditions");

                string msg = "Component SiriusQualityMeteo.Strategies, " + this.GetType().Name + ": Unhandled exception running post-condition test. ";
                throw new Exception(msg, exception);
            }
        }
        /// <summary>
        /// Test to verify the postconditions
        /// </summary>
        public string TestPostConditions(SiriusQualityWheatLAI.WheatLAIState wheatlaistate, SiriusQualityWheatLAI.WheatLeafState wheatleafstate, SiriusQualityWheatLAI.WheatLeafState wheatleafstate1, string callID)
        {
            try
            {
                //Set current values of the outputs to the static VarInfo representing the output properties of the domain classes


                //Create the collection of the conditions to test
                ConditionsCollection prc = new ConditionsCollection();
                Preconditions        pre = new Preconditions();



                string ret = "";
                ret += _issmallphytomer.TestPostConditions(wheatlaistate, wheatleafstate, wheatleafstate1, "strategy SiriusQualityWheatLAI.Strategies.IsSmallPhytomer");
                ret += _laminaexpansionthermaltime.TestPostConditions(wheatlaistate, wheatleafstate, wheatleafstate1, "strategy SiriusQualityWheatLAI.Strategies.LaminaExpansionThermalTime");
                ret += _leafexpansiondroughtfactor.TestPostConditions(wheatlaistate, wheatleafstate, wheatleafstate1, "strategy SiriusQualityWheatLAI.Strategies.LeafExpansionDroughtFactor");
                ret += _maturitythermaltime.TestPostConditions(wheatlaistate, wheatleafstate, wheatleafstate1, "strategy SiriusQualityWheatLAI.Strategies.MaturityThermalTime");
                ret += _maximumpotentialfinallai.TestPostConditions(wheatlaistate, wheatleafstate, wheatleafstate1, "strategy SiriusQualityWheatLAI.Strategies.MaximumPotentialFinalLAI");
                ret += _senescencethermaltime.TestPostConditions(wheatlaistate, wheatleafstate, wheatleafstate1, "strategy SiriusQualityWheatLAI.Strategies.SenescenceThermalTime");
                ret += _updateleafarea.TestPostConditions(wheatlaistate, wheatleafstate, wheatleafstate1, "strategy SiriusQualityWheatLAI.Strategies.UpdateLeafArea");
                ret += _waterlimitedleafexpansion.TestPostConditions(wheatlaistate, wheatleafstate, wheatleafstate1, "strategy SiriusQualityWheatLAI.Strategies.WaterLimitedLeafExpansion");
                if (ret != "")
                {
                    pre.TestsOut(ret, true, "   postconditions tests of associated classes");
                }

                //GENERATED CODE END - PLACE YOUR CUSTOM CODE BELOW - Section4
                //Code written below will not be overwritten by a future code generation



                //End of custom code. Do not place your custom code below. It will be overwritten by a future code generation.
                //PLACE YOUR CUSTOM CODE ABOVE - GENERATED CODE START - Section4

                //Get the evaluation of postconditions
                string postConditionsResult = pre.VerifyPostconditions(prc, callID);
                //if we have errors, send it to the configured output
                if (!string.IsNullOrEmpty(postConditionsResult))
                {
                    pre.TestsOut(postConditionsResult, true, "PostConditions errors in component SiriusQualityWheatLAI.Strategies, strategy " + this.GetType().Name);
                }
                return(postConditionsResult);
            }
            catch (Exception exception)
            {
                //Uncomment the next line to use the trace
                //TraceStrategies.TraceEvent(System.Diagnostics.TraceEventType.Error, 1001,	"Strategy: " + this.GetType().Name + " - Unhandled exception running post-conditions");

                string msg = "Component SiriusQualityWheatLAI.Strategies, " + this.GetType().Name + ": Unhandled exception running post-condition test. ";
                throw new Exception(msg, exception);
            }
        }
コード例 #11
0
        /// <summary>
        /// Test to verify the postconditions
        /// </summary>
        public string TestPostConditions(SiriusQualityPhenology.PhenologyState phenologystate, SiriusQualityPhenology.PhenologyState phenologystate1, string callID)
        {
            try
            {
                //Set current values of the outputs to the static VarInfo representing the output properties of the domain classes


                //Create the collection of the conditions to test
                ConditionsCollection prc = new ConditionsCollection();
                Preconditions        pre = new Preconditions();



                string ret = "";
                ret += _calculateleafnumber.TestPostConditions(phenologystate, phenologystate1, "strategy SiriusQualityPhenology.Strategies.CalculateLeafNumber");
                ret += _calculatephyllochron.TestPostConditions(phenologystate, phenologystate1, "strategy SiriusQualityPhenology.Strategies.CalculatePhyllochron");
                ret += _calculateshootnumber.TestPostConditions(phenologystate, phenologystate1, "strategy SiriusQualityPhenology.Strategies.CalculateShootNumber");
                ret += _calculatevernalizationprogress.TestPostConditions(phenologystate, phenologystate1, "strategy SiriusQualityPhenology.Strategies.CalculateVernalizationProgress");
                ret += _registerzadok.TestPostConditions(phenologystate, phenologystate1, "strategy SiriusQualityPhenology.Strategies.RegisterZadok");
                ret += _updateleafflag.TestPostConditions(phenologystate, phenologystate1, "strategy SiriusQualityPhenology.Strategies.UpdateLeafFlag");
                ret += _updatephase.TestPostConditions(phenologystate, phenologystate1, "strategy SiriusQualityPhenology.Strategies.UpdatePhase");
                if (ret != "")
                {
                    pre.TestsOut(ret, true, "   postconditions tests of associated classes");
                }

                //GENERATED CODE END - PLACE YOUR CUSTOM CODE BELOW - Section4
                //Code written below will not be overwritten by a future code generation



                //End of custom code. Do not place your custom code below. It will be overwritten by a future code generation.
                //PLACE YOUR CUSTOM CODE ABOVE - GENERATED CODE START - Section4

                //Get the evaluation of postconditions
                string postConditionsResult = pre.VerifyPostconditions(prc, callID);
                //if we have errors, send it to the configured output
                if (!string.IsNullOrEmpty(postConditionsResult))
                {
                    pre.TestsOut(postConditionsResult, true, "PostConditions errors in component SiriusQualityPhenology.Strategies, strategy " + this.GetType().Name);
                }
                return(postConditionsResult);
            }
            catch (Exception exception)
            {
                //Uncomment the next line to use the trace
                //TraceStrategies.TraceEvent(System.Diagnostics.TraceEventType.Error, 1001,	"Strategy: " + this.GetType().Name + " - Unhandled exception running post-conditions");

                string msg = "Component SiriusQualityPhenology.Strategies, " + this.GetType().Name + ": Unhandled exception running post-condition test. ";
                throw new Exception(msg, exception);
            }
        }
 public string TestPostConditions(SiriusQualityPhenology.DomainClass.PhenologyState s, SiriusQualityPhenology.DomainClass.PhenologyState s1, SiriusQualityPhenology.DomainClass.PhenologyRate r, SiriusQualityPhenology.DomainClass.PhenologyAuxiliary a, SiriusQualityPhenology.DomainClass.PhenologyExogenous ex, string callID)
 {
     try
     {
         //Set current values of the outputs to the static VarInfo representing the output properties of the domain classes
         SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.vernaprog.CurrentValue       = s.vernaprog;
         SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.minFinalNumber.CurrentValue  = s.minFinalNumber;
         SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.calendarMoments.CurrentValue = s.calendarMoments;
         SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.calendarDates.CurrentValue   = s.calendarDates;
         SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.calendarCumuls.CurrentValue  = s.calendarCumuls;
         ConditionsCollection prc = new ConditionsCollection();
         Preconditions        pre = new Preconditions();
         RangeBasedCondition  r21 = new RangeBasedCondition(SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.vernaprog);
         if (r21.ApplicableVarInfoValueTypes.Contains(SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.vernaprog.ValueType))
         {
             prc.AddCondition(r21);
         }
         RangeBasedCondition r22 = new RangeBasedCondition(SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.minFinalNumber);
         if (r22.ApplicableVarInfoValueTypes.Contains(SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.minFinalNumber.ValueType))
         {
             prc.AddCondition(r22);
         }
         RangeBasedCondition r23 = new RangeBasedCondition(SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.calendarMoments);
         if (r23.ApplicableVarInfoValueTypes.Contains(SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.calendarMoments.ValueType))
         {
             prc.AddCondition(r23);
         }
         RangeBasedCondition r24 = new RangeBasedCondition(SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.calendarDates);
         if (r24.ApplicableVarInfoValueTypes.Contains(SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.calendarDates.ValueType))
         {
             prc.AddCondition(r24);
         }
         RangeBasedCondition r25 = new RangeBasedCondition(SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.calendarCumuls);
         if (r25.ApplicableVarInfoValueTypes.Contains(SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.calendarCumuls.ValueType))
         {
             prc.AddCondition(r25);
         }
         string postConditionsResult = pre.VerifyPostconditions(prc, callID); if (!string.IsNullOrEmpty(postConditionsResult))
         {
             pre.TestsOut(postConditionsResult, true, "PostConditions errors in strategy " + this.GetType().Name);
         }
         return(postConditionsResult);
     }
     catch (Exception exception)
     {
         string msg = "SiriusQuality.Phenology, " + this.GetType().Name + ": Unhandled exception running post-condition test. ";
         throw new Exception(msg, exception);
     }
 }
コード例 #13
0
 public string TestPostConditions(SiriusQualityPhenology.DomainClass.PhenologyState s, SiriusQualityPhenology.DomainClass.PhenologyState s1, SiriusQualityPhenology.DomainClass.PhenologyRate r, SiriusQualityPhenology.DomainClass.PhenologyAuxiliary a, SiriusQualityPhenology.DomainClass.PhenologyExogenous ex, string callID)
 {
     try
     {
         //Set current values of the outputs to the static VarInfo representing the output properties of the domain classes
         SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.hasZadokStageChanged.CurrentValue = s.hasZadokStageChanged;
         SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.currentZadokStage.CurrentValue    = s.currentZadokStage;
         SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.calendarMoments.CurrentValue      = s.calendarMoments;
         SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.calendarDates.CurrentValue        = s.calendarDates;
         SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.calendarCumuls.CurrentValue       = s.calendarCumuls;
         ConditionsCollection prc = new ConditionsCollection();
         Preconditions        pre = new Preconditions();
         RangeBasedCondition  r16 = new RangeBasedCondition(SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.hasZadokStageChanged);
         if (r16.ApplicableVarInfoValueTypes.Contains(SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.hasZadokStageChanged.ValueType))
         {
             prc.AddCondition(r16);
         }
         RangeBasedCondition r17 = new RangeBasedCondition(SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.currentZadokStage);
         if (r17.ApplicableVarInfoValueTypes.Contains(SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.currentZadokStage.ValueType))
         {
             prc.AddCondition(r17);
         }
         RangeBasedCondition r18 = new RangeBasedCondition(SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.calendarMoments);
         if (r18.ApplicableVarInfoValueTypes.Contains(SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.calendarMoments.ValueType))
         {
             prc.AddCondition(r18);
         }
         RangeBasedCondition r19 = new RangeBasedCondition(SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.calendarDates);
         if (r19.ApplicableVarInfoValueTypes.Contains(SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.calendarDates.ValueType))
         {
             prc.AddCondition(r19);
         }
         RangeBasedCondition r20 = new RangeBasedCondition(SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.calendarCumuls);
         if (r20.ApplicableVarInfoValueTypes.Contains(SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.calendarCumuls.ValueType))
         {
             prc.AddCondition(r20);
         }
         string postConditionsResult = pre.VerifyPostconditions(prc, callID); if (!string.IsNullOrEmpty(postConditionsResult))
         {
             pre.TestsOut(postConditionsResult, true, "PostConditions errors in strategy " + this.GetType().Name);
         }
         return(postConditionsResult);
     }
     catch (Exception exception)
     {
         string msg = "SiriusQuality.Phenology, " + this.GetType().Name + ": Unhandled exception running post-condition test. ";
         throw new Exception(msg, exception);
     }
 }
コード例 #14
0
 public string TestPostConditions(Phenology.DomainClass.PhenologyState s, Phenology.DomainClass.PhenologyState s1, Phenology.DomainClass.PhenologyRate r, Phenology.DomainClass.PhenologyAuxiliary a, Phenology.DomainClass.PhenologyExogenous ex, string callID)
 {
     try
     {
         //Set current values of the outputs to the static VarInfo representing the output properties of the domain classes
         Phenology.DomainClass.PhenologyStateVarInfo.hasFlagLeafLiguleAppeared.CurrentValue = s.hasFlagLeafLiguleAppeared;
         Phenology.DomainClass.PhenologyStateVarInfo.calendarMoments.CurrentValue           = s.calendarMoments;
         Phenology.DomainClass.PhenologyStateVarInfo.calendarDates.CurrentValue             = s.calendarDates;
         Phenology.DomainClass.PhenologyStateVarInfo.calendarCumuls.CurrentValue            = s.calendarCumuls;
         ConditionsCollection prc = new ConditionsCollection();
         Preconditions        pre = new Preconditions();
         RangeBasedCondition  r10 = new RangeBasedCondition(Phenology.DomainClass.PhenologyStateVarInfo.hasFlagLeafLiguleAppeared);
         if (r10.ApplicableVarInfoValueTypes.Contains(Phenology.DomainClass.PhenologyStateVarInfo.hasFlagLeafLiguleAppeared.ValueType))
         {
             prc.AddCondition(r10);
         }
         RangeBasedCondition r11 = new RangeBasedCondition(Phenology.DomainClass.PhenologyStateVarInfo.calendarMoments);
         if (r11.ApplicableVarInfoValueTypes.Contains(Phenology.DomainClass.PhenologyStateVarInfo.calendarMoments.ValueType))
         {
             prc.AddCondition(r11);
         }
         RangeBasedCondition r12 = new RangeBasedCondition(Phenology.DomainClass.PhenologyStateVarInfo.calendarDates);
         if (r12.ApplicableVarInfoValueTypes.Contains(Phenology.DomainClass.PhenologyStateVarInfo.calendarDates.ValueType))
         {
             prc.AddCondition(r12);
         }
         RangeBasedCondition r13 = new RangeBasedCondition(Phenology.DomainClass.PhenologyStateVarInfo.calendarCumuls);
         if (r13.ApplicableVarInfoValueTypes.Contains(Phenology.DomainClass.PhenologyStateVarInfo.calendarCumuls.ValueType))
         {
             prc.AddCondition(r13);
         }
         string postConditionsResult = pre.VerifyPostconditions(prc, callID); if (!string.IsNullOrEmpty(postConditionsResult))
         {
             pre.TestsOut(postConditionsResult, true, "PostConditions errors in strategy " + this.GetType().Name);
         }
         return(postConditionsResult);
     }
     catch (Exception exception)
     {
         string msg = ".Phenology, " + this.GetType().Name + ": Unhandled exception running post-condition test. ";
         throw new Exception(msg, exception);
     }
 }
コード例 #15
0
 public string TestPostConditions(Phenology.DomainClass.PhenologyState s, Phenology.DomainClass.PhenologyState s1, Phenology.DomainClass.PhenologyRate r, Phenology.DomainClass.PhenologyAuxiliary a, Phenology.DomainClass.PhenologyExogenous ex, string callID)
 {
     try
     {
         //Set current values of the outputs to the static VarInfo representing the output properties of the domain classes
         Phenology.DomainClass.PhenologyStateVarInfo.gAImean.CurrentValue   = s.gAImean;
         Phenology.DomainClass.PhenologyStateVarInfo.pastMaxAI.CurrentValue = s.pastMaxAI;
         Phenology.DomainClass.PhenologyStateVarInfo.listTTShootWindowForPTQ1.CurrentValue = s.listTTShootWindowForPTQ1;
         Phenology.DomainClass.PhenologyStateVarInfo.listGAITTWindowForPTQ.CurrentValue    = s.listGAITTWindowForPTQ;
         ConditionsCollection prc = new ConditionsCollection();
         Preconditions        pre = new Preconditions();
         RangeBasedCondition  r7  = new RangeBasedCondition(Phenology.DomainClass.PhenologyStateVarInfo.gAImean);
         if (r7.ApplicableVarInfoValueTypes.Contains(Phenology.DomainClass.PhenologyStateVarInfo.gAImean.ValueType))
         {
             prc.AddCondition(r7);
         }
         RangeBasedCondition r8 = new RangeBasedCondition(Phenology.DomainClass.PhenologyStateVarInfo.pastMaxAI);
         if (r8.ApplicableVarInfoValueTypes.Contains(Phenology.DomainClass.PhenologyStateVarInfo.pastMaxAI.ValueType))
         {
             prc.AddCondition(r8);
         }
         RangeBasedCondition r9 = new RangeBasedCondition(Phenology.DomainClass.PhenologyStateVarInfo.listTTShootWindowForPTQ1);
         if (r9.ApplicableVarInfoValueTypes.Contains(Phenology.DomainClass.PhenologyStateVarInfo.listTTShootWindowForPTQ1.ValueType))
         {
             prc.AddCondition(r9);
         }
         RangeBasedCondition r10 = new RangeBasedCondition(Phenology.DomainClass.PhenologyStateVarInfo.listGAITTWindowForPTQ);
         if (r10.ApplicableVarInfoValueTypes.Contains(Phenology.DomainClass.PhenologyStateVarInfo.listGAITTWindowForPTQ.ValueType))
         {
             prc.AddCondition(r10);
         }
         string postConditionsResult = pre.VerifyPostconditions(prc, callID); if (!string.IsNullOrEmpty(postConditionsResult))
         {
             pre.TestsOut(postConditionsResult, true, "PostConditions errors in strategy " + this.GetType().Name);
         }
         return(postConditionsResult);
     }
     catch (Exception exception)
     {
         string msg = ".Phenology, " + this.GetType().Name + ": Unhandled exception running post-condition test. ";
         throw new Exception(msg, exception);
     }
 }
コード例 #16
0
 public string TestPostConditions(SiriusQualityPhenology.DomainClass.PhenologyState s, SiriusQualityPhenology.DomainClass.PhenologyState s1, SiriusQualityPhenology.DomainClass.PhenologyRate r, SiriusQualityPhenology.DomainClass.PhenologyAuxiliary a, SiriusQualityPhenology.DomainClass.PhenologyExogenous ex, string callID)
 {
     try
     {
         //Set current values of the outputs to the static VarInfo representing the output properties of the domain classes
         SiriusQualityPhenology.DomainClass.PhenologyAuxiliaryVarInfo.cumulTTFromZC_65.CurrentValue = a.cumulTTFromZC_65;
         SiriusQualityPhenology.DomainClass.PhenologyAuxiliaryVarInfo.cumulTTFromZC_39.CurrentValue = a.cumulTTFromZC_39;
         SiriusQualityPhenology.DomainClass.PhenologyAuxiliaryVarInfo.cumulTTFromZC_91.CurrentValue = a.cumulTTFromZC_91;
         ConditionsCollection prc = new ConditionsCollection();
         Preconditions        pre = new Preconditions();
         RangeBasedCondition  r4  = new RangeBasedCondition(SiriusQualityPhenology.DomainClass.PhenologyAuxiliaryVarInfo.cumulTTFromZC_65);
         if (r4.ApplicableVarInfoValueTypes.Contains(SiriusQualityPhenology.DomainClass.PhenologyAuxiliaryVarInfo.cumulTTFromZC_65.ValueType))
         {
             prc.AddCondition(r4);
         }
         RangeBasedCondition r5 = new RangeBasedCondition(SiriusQualityPhenology.DomainClass.PhenologyAuxiliaryVarInfo.cumulTTFromZC_39);
         if (r5.ApplicableVarInfoValueTypes.Contains(SiriusQualityPhenology.DomainClass.PhenologyAuxiliaryVarInfo.cumulTTFromZC_39.ValueType))
         {
             prc.AddCondition(r5);
         }
         RangeBasedCondition r6 = new RangeBasedCondition(SiriusQualityPhenology.DomainClass.PhenologyAuxiliaryVarInfo.cumulTTFromZC_91);
         if (r6.ApplicableVarInfoValueTypes.Contains(SiriusQualityPhenology.DomainClass.PhenologyAuxiliaryVarInfo.cumulTTFromZC_91.ValueType))
         {
             prc.AddCondition(r6);
         }
         string postConditionsResult = pre.VerifyPostconditions(prc, callID); if (!string.IsNullOrEmpty(postConditionsResult))
         {
             pre.TestsOut(postConditionsResult, true, "PostConditions errors in strategy " + this.GetType().Name);
         }
         return(postConditionsResult);
     }
     catch (Exception exception)
     {
         string msg = "SiriusQuality.Phenology, " + this.GetType().Name + ": Unhandled exception running post-condition test. ";
         throw new Exception(msg, exception);
     }
 }
        //Parameters static VarInfo list of the composite class


        #endregion

        #region pre/post conditions management

        /// <summary>
        /// Test to verify the postconditions
        /// </summary>
        public string TestPostConditions(SiriusQualityWheatLAI.WheatLAIState wheatlaistate, SiriusQualityWheatLAI.WheatLeafState wheatleafstate, SiriusQualityWheatLAI.WheatLeafState wheatleafstate1, string callID)
        {
            try
            {
                //Set current values of the outputs to the static VarInfo representing the output properties of the domain classes

                SiriusQualityWheatLAI.WheatLeafStateVarInfo.MaxAI.CurrentValue       = wheatleafstate.MaxAI;
                SiriusQualityWheatLAI.WheatLAIStateVarInfo.incDeltaArea.CurrentValue = wheatlaistate.incDeltaArea;
                SiriusQualityWheatLAI.WheatLeafStateVarInfo.deltaAI.CurrentValue     = wheatleafstate.deltaAI;
                SiriusQualityWheatLAI.WheatLeafStateVarInfo.GAI.CurrentValue         = wheatleafstate.GAI;
                SiriusQualityWheatLAI.WheatLeafStateVarInfo.LaminaAI.CurrentValue    = wheatleafstate.LaminaAI;
                SiriusQualityWheatLAI.WheatLeafStateVarInfo.SheathAI.CurrentValue    = wheatleafstate.SheathAI;

                //Create the collection of the conditions to test
                ConditionsCollection prc = new ConditionsCollection();
                Preconditions        pre = new Preconditions();


                RangeBasedCondition r12 = new RangeBasedCondition(SiriusQualityWheatLAI.WheatLeafStateVarInfo.MaxAI);
                if (r12.ApplicableVarInfoValueTypes.Contains(SiriusQualityWheatLAI.WheatLeafStateVarInfo.MaxAI.ValueType))
                {
                    prc.AddCondition(r12);
                }
                RangeBasedCondition r13 = new RangeBasedCondition(SiriusQualityWheatLAI.WheatLAIStateVarInfo.incDeltaArea);
                if (r13.ApplicableVarInfoValueTypes.Contains(SiriusQualityWheatLAI.WheatLAIStateVarInfo.incDeltaArea.ValueType))
                {
                    prc.AddCondition(r13);
                }
                RangeBasedCondition r14 = new RangeBasedCondition(SiriusQualityWheatLAI.WheatLeafStateVarInfo.deltaAI);
                if (r14.ApplicableVarInfoValueTypes.Contains(SiriusQualityWheatLAI.WheatLeafStateVarInfo.deltaAI.ValueType))
                {
                    prc.AddCondition(r14);
                }
                RangeBasedCondition r15 = new RangeBasedCondition(SiriusQualityWheatLAI.WheatLeafStateVarInfo.GAI);
                if (r15.ApplicableVarInfoValueTypes.Contains(SiriusQualityWheatLAI.WheatLeafStateVarInfo.GAI.ValueType))
                {
                    prc.AddCondition(r15);
                }
                RangeBasedCondition r16 = new RangeBasedCondition(SiriusQualityWheatLAI.WheatLeafStateVarInfo.LaminaAI);
                if (r16.ApplicableVarInfoValueTypes.Contains(SiriusQualityWheatLAI.WheatLeafStateVarInfo.LaminaAI.ValueType))
                {
                    prc.AddCondition(r16);
                }
                RangeBasedCondition r17 = new RangeBasedCondition(SiriusQualityWheatLAI.WheatLeafStateVarInfo.SheathAI);
                if (r17.ApplicableVarInfoValueTypes.Contains(SiriusQualityWheatLAI.WheatLeafStateVarInfo.SheathAI.ValueType))
                {
                    prc.AddCondition(r17);
                }



                //GENERATED CODE END - PLACE YOUR CUSTOM CODE BELOW - Section4
                //Code written below will not be overwritten by a future code generation



                //End of custom code. Do not place your custom code below. It will be overwritten by a future code generation.
                //PLACE YOUR CUSTOM CODE ABOVE - GENERATED CODE START - Section4

                //Get the evaluation of postconditions
                string postConditionsResult = pre.VerifyPostconditions(prc, callID);
                //if we have errors, send it to the configured output
                if (!string.IsNullOrEmpty(postConditionsResult))
                {
                    pre.TestsOut(postConditionsResult, true, "PostConditions errors in component SiriusQualityWheatLAI.Strategies, strategy " + this.GetType().Name);
                }
                return(postConditionsResult);
            }
            catch (Exception exception)
            {
                //Uncomment the next line to use the trace
                //TraceStrategies.TraceEvent(System.Diagnostics.TraceEventType.Error, 1001,	"Strategy: " + this.GetType().Name + " - Unhandled exception running post-conditions");

                string msg = "Component SiriusQualityWheatLAI.Strategies, " + this.GetType().Name + ": Unhandled exception running post-condition test. ";
                throw new Exception(msg, exception);
            }
        }
コード例 #18
0
        //Parameters static VarInfo list of the composite class


        #endregion

        #region pre/post conditions management

        /// <summary>
        /// Test to verify the postconditions
        /// </summary>
        public string TestPostConditions(SiriusQualityMeteo.MeteoState meteostate, string callID)
        {
            try
            {
                //Set current values of the outputs to the static VarInfo representing the output properties of the domain classes

                SiriusQualityMeteo.MeteoStateVarInfo.dayLength.CurrentValue            = meteostate.dayLength;
                SiriusQualityMeteo.MeteoStateVarInfo.photoperiod.CurrentValue          = meteostate.photoperiod;
                SiriusQualityMeteo.MeteoStateVarInfo.radTopAtm.CurrentValue            = meteostate.radTopAtm;
                SiriusQualityMeteo.MeteoStateVarInfo.solarDeclination.CurrentValue     = meteostate.solarDeclination;
                SiriusQualityMeteo.MeteoStateVarInfo.dayLengthHorizonZero.CurrentValue = meteostate.dayLengthHorizonZero;
                SiriusQualityMeteo.MeteoStateVarInfo.radTopAtmHorizonZero.CurrentValue = meteostate.radTopAtmHorizonZero;

                //Create the collection of the conditions to test
                ConditionsCollection prc = new ConditionsCollection();
                Preconditions        pre = new Preconditions();


                RangeBasedCondition r2 = new RangeBasedCondition(SiriusQualityMeteo.MeteoStateVarInfo.dayLength);
                if (r2.ApplicableVarInfoValueTypes.Contains(SiriusQualityMeteo.MeteoStateVarInfo.dayLength.ValueType))
                {
                    prc.AddCondition(r2);
                }
                RangeBasedCondition r3 = new RangeBasedCondition(SiriusQualityMeteo.MeteoStateVarInfo.photoperiod);
                if (r3.ApplicableVarInfoValueTypes.Contains(SiriusQualityMeteo.MeteoStateVarInfo.photoperiod.ValueType))
                {
                    prc.AddCondition(r3);
                }
                RangeBasedCondition r4 = new RangeBasedCondition(SiriusQualityMeteo.MeteoStateVarInfo.radTopAtm);
                if (r4.ApplicableVarInfoValueTypes.Contains(SiriusQualityMeteo.MeteoStateVarInfo.radTopAtm.ValueType))
                {
                    prc.AddCondition(r4);
                }
                RangeBasedCondition r5 = new RangeBasedCondition(SiriusQualityMeteo.MeteoStateVarInfo.solarDeclination);
                if (r5.ApplicableVarInfoValueTypes.Contains(SiriusQualityMeteo.MeteoStateVarInfo.solarDeclination.ValueType))
                {
                    prc.AddCondition(r5);
                }
                RangeBasedCondition r6 = new RangeBasedCondition(SiriusQualityMeteo.MeteoStateVarInfo.dayLengthHorizonZero);
                if (r6.ApplicableVarInfoValueTypes.Contains(SiriusQualityMeteo.MeteoStateVarInfo.dayLengthHorizonZero.ValueType))
                {
                    prc.AddCondition(r6);
                }
                RangeBasedCondition r7 = new RangeBasedCondition(SiriusQualityMeteo.MeteoStateVarInfo.radTopAtmHorizonZero);
                if (r7.ApplicableVarInfoValueTypes.Contains(SiriusQualityMeteo.MeteoStateVarInfo.radTopAtmHorizonZero.ValueType))
                {
                    prc.AddCondition(r7);
                }



                //GENERATED CODE END - PLACE YOUR CUSTOM CODE BELOW - Section4
                //Code written below will not be overwritten by a future code generation



                //End of custom code. Do not place your custom code below. It will be overwritten by a future code generation.
                //PLACE YOUR CUSTOM CODE ABOVE - GENERATED CODE START - Section4

                //Get the evaluation of postconditions
                string postConditionsResult = pre.VerifyPostconditions(prc, callID);
                //if we have errors, send it to the configured output
                if (!string.IsNullOrEmpty(postConditionsResult))
                {
                    pre.TestsOut(postConditionsResult, true, "PostConditions errors in component SiriusQualityMeteo.Strategies, strategy " + this.GetType().Name);
                }
                return(postConditionsResult);
            }
            catch (Exception exception)
            {
                //Uncomment the next line to use the trace
                //TraceStrategies.TraceEvent(System.Diagnostics.TraceEventType.Error, 1001,	"Strategy: " + this.GetType().Name + " - Unhandled exception running post-conditions");

                string msg = "Component SiriusQualityMeteo.Strategies, " + this.GetType().Name + ": Unhandled exception running post-condition test. ";
                throw new Exception(msg, exception);
            }
        }
コード例 #19
0
        public string TestPostConditions(SiriusQualitySnow.DomainClass.SnowState s, SiriusQualitySnow.DomainClass.SnowState s1, SiriusQualitySnow.DomainClass.SnowRate r, SiriusQualitySnow.DomainClass.SnowAuxiliary a, SiriusQualitySnow.DomainClass.SnowExogenous ex, string callID)
        {
            try
            {
                //Set current values of the outputs to the static VarInfo representing the output properties of the domain classes
                SiriusQualitySnow.DomainClass.SnowStateVarInfo.tmaxrec.CurrentValue   = s.tmaxrec;
                SiriusQualitySnow.DomainClass.SnowStateVarInfo.ps.CurrentValue        = s.ps;
                SiriusQualitySnow.DomainClass.SnowRateVarInfo.Mrf.CurrentValue        = r.Mrf;
                SiriusQualitySnow.DomainClass.SnowAuxiliaryVarInfo.tavg.CurrentValue  = a.tavg;
                SiriusQualitySnow.DomainClass.SnowStateVarInfo.Swet.CurrentValue      = s.Swet;
                SiriusQualitySnow.DomainClass.SnowStateVarInfo.Snowmelt.CurrentValue  = s.Snowmelt;
                SiriusQualitySnow.DomainClass.SnowRateVarInfo.Snowaccu.CurrentValue   = r.Snowaccu;
                SiriusQualitySnow.DomainClass.SnowStateVarInfo.Sdry.CurrentValue      = s.Sdry;
                SiriusQualitySnow.DomainClass.SnowStateVarInfo.Sdepth.CurrentValue    = s.Sdepth;
                SiriusQualitySnow.DomainClass.SnowStateVarInfo.tminrec.CurrentValue   = s.tminrec;
                SiriusQualitySnow.DomainClass.SnowRateVarInfo.M.CurrentValue          = r.M;
                SiriusQualitySnow.DomainClass.SnowStateVarInfo.preciprec.CurrentValue = s.preciprec;
                SiriusQualitySnow.DomainClass.SnowStateVarInfo.Sdepth_cm.CurrentValue = s.Sdepth_cm;

                ConditionsCollection prc = new ConditionsCollection();
                Preconditions        pre = new Preconditions();

                RangeBasedCondition r21 = new RangeBasedCondition(SiriusQualitySnow.DomainClass.SnowStateVarInfo.tmaxrec);
                if (r21.ApplicableVarInfoValueTypes.Contains(SiriusQualitySnow.DomainClass.SnowStateVarInfo.tmaxrec.ValueType))
                {
                    prc.AddCondition(r21);
                }
                RangeBasedCondition r22 = new RangeBasedCondition(SiriusQualitySnow.DomainClass.SnowStateVarInfo.ps);
                if (r22.ApplicableVarInfoValueTypes.Contains(SiriusQualitySnow.DomainClass.SnowStateVarInfo.ps.ValueType))
                {
                    prc.AddCondition(r22);
                }
                RangeBasedCondition r23 = new RangeBasedCondition(SiriusQualitySnow.DomainClass.SnowRateVarInfo.Mrf);
                if (r23.ApplicableVarInfoValueTypes.Contains(SiriusQualitySnow.DomainClass.SnowRateVarInfo.Mrf.ValueType))
                {
                    prc.AddCondition(r23);
                }
                RangeBasedCondition r24 = new RangeBasedCondition(SiriusQualitySnow.DomainClass.SnowAuxiliaryVarInfo.tavg);
                if (r24.ApplicableVarInfoValueTypes.Contains(SiriusQualitySnow.DomainClass.SnowAuxiliaryVarInfo.tavg.ValueType))
                {
                    prc.AddCondition(r24);
                }
                RangeBasedCondition r25 = new RangeBasedCondition(SiriusQualitySnow.DomainClass.SnowStateVarInfo.Swet);
                if (r25.ApplicableVarInfoValueTypes.Contains(SiriusQualitySnow.DomainClass.SnowStateVarInfo.Swet.ValueType))
                {
                    prc.AddCondition(r25);
                }
                RangeBasedCondition r26 = new RangeBasedCondition(SiriusQualitySnow.DomainClass.SnowStateVarInfo.Snowmelt);
                if (r26.ApplicableVarInfoValueTypes.Contains(SiriusQualitySnow.DomainClass.SnowStateVarInfo.Snowmelt.ValueType))
                {
                    prc.AddCondition(r26);
                }
                RangeBasedCondition r27 = new RangeBasedCondition(SiriusQualitySnow.DomainClass.SnowRateVarInfo.Snowaccu);
                if (r27.ApplicableVarInfoValueTypes.Contains(SiriusQualitySnow.DomainClass.SnowRateVarInfo.Snowaccu.ValueType))
                {
                    prc.AddCondition(r27);
                }
                RangeBasedCondition r28 = new RangeBasedCondition(SiriusQualitySnow.DomainClass.SnowStateVarInfo.Sdry);
                if (r28.ApplicableVarInfoValueTypes.Contains(SiriusQualitySnow.DomainClass.SnowStateVarInfo.Sdry.ValueType))
                {
                    prc.AddCondition(r28);
                }
                RangeBasedCondition r29 = new RangeBasedCondition(SiriusQualitySnow.DomainClass.SnowStateVarInfo.Sdepth);
                if (r29.ApplicableVarInfoValueTypes.Contains(SiriusQualitySnow.DomainClass.SnowStateVarInfo.Sdepth.ValueType))
                {
                    prc.AddCondition(r29);
                }
                RangeBasedCondition r30 = new RangeBasedCondition(SiriusQualitySnow.DomainClass.SnowStateVarInfo.tminrec);
                if (r30.ApplicableVarInfoValueTypes.Contains(SiriusQualitySnow.DomainClass.SnowStateVarInfo.tminrec.ValueType))
                {
                    prc.AddCondition(r30);
                }
                RangeBasedCondition r31 = new RangeBasedCondition(SiriusQualitySnow.DomainClass.SnowRateVarInfo.M);
                if (r31.ApplicableVarInfoValueTypes.Contains(SiriusQualitySnow.DomainClass.SnowRateVarInfo.M.ValueType))
                {
                    prc.AddCondition(r31);
                }
                RangeBasedCondition r32 = new RangeBasedCondition(SiriusQualitySnow.DomainClass.SnowStateVarInfo.preciprec);
                if (r32.ApplicableVarInfoValueTypes.Contains(SiriusQualitySnow.DomainClass.SnowStateVarInfo.preciprec.ValueType))
                {
                    prc.AddCondition(r32);
                }
                RangeBasedCondition r33 = new RangeBasedCondition(SiriusQualitySnow.DomainClass.SnowStateVarInfo.Sdepth_cm);
                if (r33.ApplicableVarInfoValueTypes.Contains(SiriusQualitySnow.DomainClass.SnowStateVarInfo.Sdepth_cm.ValueType))
                {
                    prc.AddCondition(r33);
                }

                string ret = "";
                ret += _Melting.TestPostConditions(s, s1, r, a, ex, " strategy SiriusQualitySnow.Strategies.Snow");
                ret += _Refreezing.TestPostConditions(s, s1, r, a, ex, " strategy SiriusQualitySnow.Strategies.Snow");
                ret += _SnowAccumulation.TestPostConditions(s, s1, r, a, ex, " strategy SiriusQualitySnow.Strategies.Snow");
                ret += _SnowDensity.TestPostConditions(s, s1, r, a, ex, " strategy SiriusQualitySnow.Strategies.Snow");
                ret += _SnowDepth.TestPostConditions(s, s1, r, a, ex, " strategy SiriusQualitySnow.Strategies.Snow");
                ret += _SnowDepthTrans.TestPostConditions(s, s1, r, a, ex, " strategy SiriusQualitySnow.Strategies.Snow");
                ret += _SnowDry.TestPostConditions(s, s1, r, a, ex, " strategy SiriusQualitySnow.Strategies.Snow");
                ret += _SnowMelt.TestPostConditions(s, s1, r, a, ex, " strategy SiriusQualitySnow.Strategies.Snow");
                ret += _SnowWet.TestPostConditions(s, s1, r, a, ex, " strategy SiriusQualitySnow.Strategies.Snow");
                ret += _Tavg.TestPostConditions(s, s1, r, a, ex, " strategy SiriusQualitySnow.Strategies.Snow");
                ret += _TempMax.TestPostConditions(s, s1, r, a, ex, " strategy SiriusQualitySnow.Strategies.Snow");
                ret += _TempMin.TestPostConditions(s, s1, r, a, ex, " strategy SiriusQualitySnow.Strategies.Snow");
                ret += _Preciprec.TestPostConditions(s, s1, r, a, ex, " strategy SiriusQualitySnow.Strategies.Snow");
                if (ret != "")
                {
                    pre.TestsOut(ret, true, "   postconditions tests of associated classes");
                }

                string postConditionsResult = pre.VerifyPostconditions(prc, callID); if (!string.IsNullOrEmpty(postConditionsResult))
                {
                    pre.TestsOut(postConditionsResult, true, "PostConditions errors in strategy " + this.GetType().Name);
                }
                return(postConditionsResult);
            }
            catch (Exception exception)
            {
                string msg = "Component SiriusQuality.Snow, " + this.GetType().Name + ": Unhandled exception running post-condition test. ";
                throw new Exception(msg, exception);
            }
        }
コード例 #20
0
        //Parameters static VarInfo list of the composite class


        #endregion

        #region pre/post conditions management

        /// <summary>
        /// Test to verify the postconditions
        /// </summary>
        public string TestPostConditions(SiriusQualityWheatLAI.WheatLAIState wheatlaistate, string callID)
        {
            try
            {
                //Set current values of the outputs to the static VarInfo representing the output properties of the domain classes

                SiriusQualityWheatLAI.WheatLAIStateVarInfo.incDeltaAreaLimitSF.CurrentValue        = wheatlaistate.incDeltaAreaLimitSF;
                SiriusQualityWheatLAI.WheatLAIStateVarInfo.WaterLimitedPotDeltaAIList.CurrentValue = wheatlaistate.WaterLimitedPotDeltaAIList;
                SiriusQualityWheatLAI.WheatLAIStateVarInfo.potentialIncDeltaArea.CurrentValue      = wheatlaistate.potentialIncDeltaArea;
                //SiriusQualityWheatLAI.WheatLAIStateVarInfo.leafStateList.CurrentValue = wheatlaistate.leafStateList;
                SiriusQualityWheatLAI.WheatLAIStateVarInfo.isPrematurelyDying.CurrentValue = wheatlaistate.isPrematurelyDying;

                //Create the collection of the conditions to test
                ConditionsCollection prc = new ConditionsCollection();
                Preconditions        pre = new Preconditions();


                RangeBasedCondition r6 = new RangeBasedCondition(SiriusQualityWheatLAI.WheatLAIStateVarInfo.incDeltaAreaLimitSF);
                if (r6.ApplicableVarInfoValueTypes.Contains(SiriusQualityWheatLAI.WheatLAIStateVarInfo.incDeltaAreaLimitSF.ValueType))
                {
                    prc.AddCondition(r6);
                }
                RangeBasedCondition r7 = new RangeBasedCondition(SiriusQualityWheatLAI.WheatLAIStateVarInfo.WaterLimitedPotDeltaAIList);
                if (r7.ApplicableVarInfoValueTypes.Contains(SiriusQualityWheatLAI.WheatLAIStateVarInfo.WaterLimitedPotDeltaAIList.ValueType))
                {
                    prc.AddCondition(r7);
                }
                RangeBasedCondition r8 = new RangeBasedCondition(SiriusQualityWheatLAI.WheatLAIStateVarInfo.potentialIncDeltaArea);
                if (r8.ApplicableVarInfoValueTypes.Contains(SiriusQualityWheatLAI.WheatLAIStateVarInfo.potentialIncDeltaArea.ValueType))
                {
                    prc.AddCondition(r8);
                }

                /* RangeBasedCondition r9 = new RangeBasedCondition(SiriusQualityWheatLAI.WheatLAIStateVarInfo.leafStateList);
                 * if (r9.ApplicableVarInfoValueTypes.Contains(SiriusQualityWheatLAI.WheatLAIStateVarInfo.leafStateList.ValueType)) { prc.AddCondition(r9); }
                 *                   RangeBasedCondition r10 = new RangeBasedCondition(SiriusQualityWheatLAI.WheatLAIStateVarInfo.isPrematurelyDying);
                 *                   if(r10.ApplicableVarInfoValueTypes.Contains( SiriusQualityWheatLAI.WheatLAIStateVarInfo.isPrematurelyDying.ValueType)){prc.AddCondition(r10);}*/



                //GENERATED CODE END - PLACE YOUR CUSTOM CODE BELOW - Section4
                //Code written below will not be overwritten by a future code generation



                //End of custom code. Do not place your custom code below. It will be overwritten by a future code generation.
                //PLACE YOUR CUSTOM CODE ABOVE - GENERATED CODE START - Section4

                //Get the evaluation of postconditions
                string postConditionsResult = pre.VerifyPostconditions(prc, callID);
                //if we have errors, send it to the configured output
                if (!string.IsNullOrEmpty(postConditionsResult))
                {
                    pre.TestsOut(postConditionsResult, true, "PostConditions errors in component SiriusQualityWheatLAI.Strategies, strategy " + this.GetType().Name);
                }
                return(postConditionsResult);
            }
            catch (Exception exception)
            {
                //Uncomment the next line to use the trace
                //TraceStrategies.TraceEvent(System.Diagnostics.TraceEventType.Error, 1001,	"Strategy: " + this.GetType().Name + " - Unhandled exception running post-conditions");

                string msg = "Component SiriusQualityWheatLAI.Strategies, " + this.GetType().Name + ": Unhandled exception running post-condition test. ";
                throw new Exception(msg, exception);
            }
        }