private string Range(VarInfo i) { double num; string str = ""; string str2 = i.CurrentValue.GetType().ToString(); switch (str2) { case "System.Double[]": { double[] currentValue = (double[])i.CurrentValue; return(str + this.Greater(i, currentValue) + this.Smaller(i, currentValue)); } case "System.Double[,]": { double[,] v = (double[, ])i.CurrentValue; return(str + this.Greater(i, v) + this.Smaller(i, v)); } } try { num = double.Parse(i.CurrentValue.ToString()); } catch (Exception) { return(string.Concat(new object[] { "Error testing range-based preconditions. Likely the type of the CurrentValue of the VarInfo is not supported. Type:", str2, " - CurrentValue:", i.CurrentValue })); } return(str + this.Greater(i, num) + this.Smaller(i, num)); }
private string NoSmaller(VarInfo a, VarInfo b) { double aValue = double.Parse(a.CurrentValue.ToString()); double bValue = double.Parse(b.CurrentValue.ToString()); return(this.SmallerTwoInputs(a, aValue, b, bValue)); }
private string SubRanges(VarInfo a, VarInfo b) { double aValue = double.Parse(a.CurrentValue.ToString()); double bValue = double.Parse(b.CurrentValue.ToString()); return(this.SubRange(a, aValue, b, bValue)); }
private string Cannot(VarInfo a, VarInfo b) { double aValue = double.Parse(a.CurrentValue.ToString()); double bValue = double.Parse(b.CurrentValue.ToString()); return(this.CannotBeZeroIf(a, aValue, b, bValue)); }
public EvapoTranspiration() { ModellingOptions mo0_0 = new ModellingOptions(); //Parameters List <VarInfo> _parameters0_0 = new List <VarInfo>(); VarInfo v1 = new VarInfo(); v1.DefaultValue = 1; v1.Description = "if wind and vapour pressure are defined"; v1.Id = 0; v1.MaxValue = 1; v1.MinValue = 0; v1.Name = "isWindVpDefined"; v1.Size = 1; v1.Units = ""; v1.URL = ""; v1.VarType = CRA.ModelLayer.Core.VarInfo.Type.PARAMETER; v1.ValueType = VarInfoValueTypes.GetInstanceForName("Integer"); _parameters0_0.Add(v1); mo0_0.Parameters = _parameters0_0; //Inputs List <PropertyDescription> _inputs0_0 = new List <PropertyDescription>(); PropertyDescription pd1 = new PropertyDescription(); pd1.DomainClassType = typeof(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRate); pd1.PropertyName = "evapoTranspirationPriestlyTaylor"; pd1.PropertyType = (SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRateVarInfo.evapoTranspirationPriestlyTaylor).ValueType.TypeForCurrentValue; pd1.PropertyVarInfo = (SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRateVarInfo.evapoTranspirationPriestlyTaylor); _inputs0_0.Add(pd1); PropertyDescription pd2 = new PropertyDescription(); pd2.DomainClassType = typeof(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRate); pd2.PropertyName = "evapoTranspirationPenman"; pd2.PropertyType = (SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRateVarInfo.evapoTranspirationPenman).ValueType.TypeForCurrentValue; pd2.PropertyVarInfo = (SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRateVarInfo.evapoTranspirationPenman); _inputs0_0.Add(pd2); mo0_0.Inputs = _inputs0_0; //Outputs List <PropertyDescription> _outputs0_0 = new List <PropertyDescription>(); PropertyDescription pd3 = new PropertyDescription(); pd3.DomainClassType = typeof(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRate); pd3.PropertyName = "evapoTranspiration"; pd3.PropertyType = (SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRateVarInfo.evapoTranspiration).ValueType.TypeForCurrentValue; pd3.PropertyVarInfo = (SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRateVarInfo.evapoTranspiration); _outputs0_0.Add(pd3); mo0_0.Outputs = _outputs0_0; //Associated strategies List <string> lAssStrat0_0 = new List <string>(); mo0_0.AssociatedStrategies = lAssStrat0_0; //Adding the modeling options to the modeling options manager _modellingOptionsManager = new ModellingOptionsManager(mo0_0); SetStaticParametersVarInfoDefinitions(); SetPublisherData(); }
public SoilHeatFlux() { ModellingOptions mo0_0 = new ModellingOptions(); //Parameters List <VarInfo> _parameters0_0 = new List <VarInfo>(); VarInfo v1 = new VarInfo(); v1.DefaultValue = 0.9983; v1.Description = "plant cover factor"; v1.Id = 0; v1.MaxValue = 100; v1.MinValue = 0; v1.Name = "tau"; v1.Size = 1; v1.Units = ""; v1.URL = ""; v1.VarType = CRA.ModelLayer.Core.VarInfo.Type.PARAMETER; v1.ValueType = VarInfoValueTypes.GetInstanceForName("Double"); _parameters0_0.Add(v1); mo0_0.Parameters = _parameters0_0; //Inputs List <PropertyDescription> _inputs0_0 = new List <PropertyDescription>(); PropertyDescription pd1 = new PropertyDescription(); pd1.DomainClassType = typeof(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState); pd1.PropertyName = "netRadiationEquivalentEvaporation"; pd1.PropertyType = (SiriusQualityEnergyBalance.DomainClass.EnergyBalanceStateVarInfo.netRadiationEquivalentEvaporation).ValueType.TypeForCurrentValue; pd1.PropertyVarInfo = (SiriusQualityEnergyBalance.DomainClass.EnergyBalanceStateVarInfo.netRadiationEquivalentEvaporation); _inputs0_0.Add(pd1); PropertyDescription pd2 = new PropertyDescription(); pd2.DomainClassType = typeof(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState); pd2.PropertyName = "soilEvaporation"; pd2.PropertyType = (SiriusQualityEnergyBalance.DomainClass.EnergyBalanceStateVarInfo.soilEvaporation).ValueType.TypeForCurrentValue; pd2.PropertyVarInfo = (SiriusQualityEnergyBalance.DomainClass.EnergyBalanceStateVarInfo.soilEvaporation); _inputs0_0.Add(pd2); mo0_0.Inputs = _inputs0_0; //Outputs List <PropertyDescription> _outputs0_0 = new List <PropertyDescription>(); PropertyDescription pd3 = new PropertyDescription(); pd3.DomainClassType = typeof(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRate); pd3.PropertyName = "soilHeatFlux"; pd3.PropertyType = (SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRateVarInfo.soilHeatFlux).ValueType.TypeForCurrentValue; pd3.PropertyVarInfo = (SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRateVarInfo.soilHeatFlux); _outputs0_0.Add(pd3); mo0_0.Outputs = _outputs0_0; //Associated strategies List <string> lAssStrat0_0 = new List <string>(); mo0_0.AssociatedStrategies = lAssStrat0_0; //Adding the modeling options to the modeling options manager _modellingOptionsManager = new ModellingOptionsManager(mo0_0); SetStaticParametersVarInfoDefinitions(); SetPublisherData(); }
public LaminaExpansionThermalTime() { ModellingOptions mo0_0 = new ModellingOptions(); //Parameters List <VarInfo> _parameters0_0 = new List <VarInfo>(); VarInfo v1 = new VarInfo(); v1.DefaultValue = 1.1; v1.Description = "Phyllochronic duration of leaf lamina expansion"; v1.Id = 0; v1.MaxValue = 30; v1.MinValue = 0; v1.Name = "PexpL"; v1.Size = 1; v1.Units = "Phyllochron"; v1.URL = ""; v1.VarType = CRA.ModelLayer.Core.VarInfo.Type.STATE; v1.ValueType = VarInfoValueTypes.GetInstanceForName("Double"); _parameters0_0.Add(v1); mo0_0.Parameters = _parameters0_0; //Inputs List <PropertyDescription> _inputs0_0 = new List <PropertyDescription>(); PropertyDescription pd1 = new PropertyDescription(); pd1.DomainClassType = typeof(SiriusQualityWheatLAI.WheatLeafState); pd1.PropertyName = "Phyllochron"; pd1.PropertyType = ((SiriusQualityWheatLAI.WheatLeafStateVarInfo.Phyllochron)).ValueType.TypeForCurrentValue; pd1.PropertyVarInfo = (SiriusQualityWheatLAI.WheatLeafStateVarInfo.Phyllochron); _inputs0_0.Add(pd1); PropertyDescription pd2 = new PropertyDescription(); pd2.DomainClassType = typeof(SiriusQualityWheatLAI.WheatLAIState); pd2.PropertyName = "index"; pd2.PropertyType = ((SiriusQualityWheatLAI.WheatLAIStateVarInfo.index)).ValueType.TypeForCurrentValue; pd2.PropertyVarInfo = (SiriusQualityWheatLAI.WheatLAIStateVarInfo.index); _inputs0_0.Add(pd2); mo0_0.Inputs = _inputs0_0; //Outputs List <PropertyDescription> _outputs0_0 = new List <PropertyDescription>(); PropertyDescription pd3 = new PropertyDescription(); pd3.DomainClassType = typeof(SiriusQualityWheatLAI.WheatLeafState); pd3.PropertyName = "TTGroLamina"; pd3.PropertyType = ((SiriusQualityWheatLAI.WheatLeafStateVarInfo.TTGroLamina)).ValueType.TypeForCurrentValue; pd3.PropertyVarInfo = (SiriusQualityWheatLAI.WheatLeafStateVarInfo.TTGroLamina); _outputs0_0.Add(pd3); mo0_0.Outputs = _outputs0_0; //Associated strategies List <string> lAssStrat0_0 = new List <string>(); mo0_0.AssociatedStrategies = lAssStrat0_0; //Adding the modeling options to the modeling options manager _modellingOptionsManager = new ModellingOptionsManager(mo0_0); SetStaticParametersVarInfoDefinitions(); SetPublisherData(); }
public CalculateDirectExtinctionCoefBlakLeavesEllipse() { ModellingOptions mo0_0 = new ModellingOptions(); //Parameters List <VarInfo> _parameters0_0 = new List <VarInfo>(); VarInfo v1 = new VarInfo(); v1.DefaultValue = 1; v1.Description = "Clumping Index"; v1.Id = 0; v1.MaxValue = 1; v1.MinValue = 0; v1.Name = "CI"; v1.Size = 1; v1.Units = "-"; v1.URL = ""; v1.VarType = CRA.ModelLayer.Core.VarInfo.Type.STATE; v1.ValueType = VarInfoValueTypes.GetInstanceForName("Double"); _parameters0_0.Add(v1); mo0_0.Parameters = _parameters0_0; //Inputs List <PropertyDescription> _inputs0_0 = new List <PropertyDescription>(); PropertyDescription pd1 = new PropertyDescription(); pd1.DomainClassType = typeof(INRA.SiriusQualityIrradiance.Interfaces.Exogenous); pd1.PropertyName = "solarElevation"; pd1.PropertyType = ((INRA.SiriusQualityIrradiance.Interfaces.ExogenousVarInfo.solarElevation)).ValueType.TypeForCurrentValue; pd1.PropertyVarInfo = (INRA.SiriusQualityIrradiance.Interfaces.ExogenousVarInfo.solarElevation); _inputs0_0.Add(pd1); PropertyDescription pd2 = new PropertyDescription(); pd2.DomainClassType = typeof(INRA.SiriusQualityIrradiance.Interfaces.States); pd2.PropertyName = "ala"; pd2.PropertyType = ((INRA.SiriusQualityIrradiance.Interfaces.StatesVarInfo.ala)).ValueType.TypeForCurrentValue; pd2.PropertyVarInfo = (INRA.SiriusQualityIrradiance.Interfaces.StatesVarInfo.ala); _inputs0_0.Add(pd2); mo0_0.Inputs = _inputs0_0; //Outputs List <PropertyDescription> _outputs0_0 = new List <PropertyDescription>(); PropertyDescription pd3 = new PropertyDescription(); pd3.DomainClassType = typeof(INRA.SiriusQualityIrradiance.Interfaces.States); pd3.PropertyName = "k1_dir"; pd3.PropertyType = ((INRA.SiriusQualityIrradiance.Interfaces.StatesVarInfo.k1_dir)).ValueType.TypeForCurrentValue; pd3.PropertyVarInfo = (INRA.SiriusQualityIrradiance.Interfaces.StatesVarInfo.k1_dir); _outputs0_0.Add(pd3); mo0_0.Outputs = _outputs0_0; //Associated strategies List <string> lAssStrat0_0 = new List <string>(); mo0_0.AssociatedStrategies = lAssStrat0_0; //Adding the modeling options to the modeling options manager _modellingOptionsManager = new ModellingOptionsManager(mo0_0); SetStaticParametersVarInfoDefinitions(); SetPublisherData(); }
private string SubRange(VarInfo a, double aValue, VarInfo b, double bValue) { string str = ""; if ((((aValue < a.MinValue) || (aValue > a.MaxValue)) && (bValue >= b.MinValue)) && (bValue <= b.MaxValue)) { str = a.Name + " = " + aValue.ToString() + ". It cannot outrange (" + a.MinValue.ToString() + "-" + a.MaxValue.ToString() + ") if " + b.Name + " is within (" + b.MinValue.ToString() + "-" + b.MaxValue.ToString() + ") " + this._callID + ";\r\n"; } return(str); }
private string CannotBeZeroIf(VarInfo a, double aValue, VarInfo b, double bValue) { string str = ""; if ((aValue == 0.0) && (bValue != 0.0)) { str = a.Name + " cannot be = 0 if " + b.Name + " is <> 0 (" + b.Name + " = " + bValue.ToString() + " " + this._callID + ";\r\n"; } return(str); }
private string Greater(VarInfo i, double v) { string str = ""; if (v > i.MaxValue) { str = string.Concat(new object[] { i.Name, " = ", i.CurrentValue.ToString(), " (max=", i.MaxValue, " - min=", i.MinValue, ") ", this._callID, ";\r\n" }); } return(str); }
/// <summary> /// Builds the instance of this condition. It requires one VarInfo to be used in the test /// </summary> /// <param name="varInfo"></param> public RangeBasedCondition(VarInfo varInfo) { if (varInfo == null) { throw new ArgumentNullException("varInfo"); } this._varInfo = varInfo; this._controlledVarInfos = new List <VarInfo> { this._varInfo }; }
private string SmallerTwoInputs(VarInfo a, double aValue, VarInfo b, double bValue) { string str = ""; if (aValue < bValue) { str = a.Name + " < " + b.Name + " ("; str = str + a.CurrentValue.ToString() + " < " + b.CurrentValue.ToString() + ") " + this._callID + ";\r\n"; } return(str); }
/// <summary> /// Builds the instance of this condition. It requires one VarInfo to be used in the test /// </summary> /// <param name="varInfo"></param> public AtLeastOneDifferentFromZeroCondition(VarInfo varInfo) { if (varInfo == null) { throw new ArgumentNullException("varInfo"); } this._varInfo = varInfo; this._controlledVarInfos = new List <VarInfo> { this._varInfo }; }
private string AtLeastOneDifferent(VarInfo i) { string str4 = i.CurrentValue.GetType().ToString(); if ((str4 != null) && (str4 == "System.Double[,]")) { double[,] vmatrix = (double[, ])i.CurrentValue; return(this.AtLeast(i, vmatrix)); } double[] currentValue = (double[])i.CurrentValue; return(this.AtLeast(i, currentValue)); }
public DiffusionLimitedEvaporation() { ModellingOptions mo0_0 = new ModellingOptions(); //Parameters List <VarInfo> _parameters0_0 = new List <VarInfo>(); VarInfo v1 = new VarInfo(); v1.DefaultValue = 4.2; v1.Description = "soil Diffusion Constant"; v1.Id = 0; v1.MaxValue = 10; v1.MinValue = 0; v1.Name = "soilDiffusionConstant"; v1.Size = 1; v1.Units = ""; v1.URL = ""; v1.VarType = CRA.ModelLayer.Core.VarInfo.Type.PARAMETER; v1.ValueType = VarInfoValueTypes.GetInstanceForName("Double"); _parameters0_0.Add(v1); mo0_0.Parameters = _parameters0_0; //Inputs List <PropertyDescription> _inputs0_0 = new List <PropertyDescription>(); PropertyDescription pd1 = new PropertyDescription(); pd1.DomainClassType = typeof(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliary); pd1.PropertyName = "deficitOnTopLayers"; pd1.PropertyType = (SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliaryVarInfo.deficitOnTopLayers).ValueType.TypeForCurrentValue; pd1.PropertyVarInfo = (SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliaryVarInfo.deficitOnTopLayers); _inputs0_0.Add(pd1); mo0_0.Inputs = _inputs0_0; //Outputs List <PropertyDescription> _outputs0_0 = new List <PropertyDescription>(); PropertyDescription pd2 = new PropertyDescription(); pd2.DomainClassType = typeof(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState); pd2.PropertyName = "diffusionLimitedEvaporation"; pd2.PropertyType = (SiriusQualityEnergyBalance.DomainClass.EnergyBalanceStateVarInfo.diffusionLimitedEvaporation).ValueType.TypeForCurrentValue; pd2.PropertyVarInfo = (SiriusQualityEnergyBalance.DomainClass.EnergyBalanceStateVarInfo.diffusionLimitedEvaporation); _outputs0_0.Add(pd2); mo0_0.Outputs = _outputs0_0; //Associated strategies List <string> lAssStrat0_0 = new List <string>(); mo0_0.AssociatedStrategies = lAssStrat0_0; //Adding the modeling options to the modeling options manager _modellingOptionsManager = new ModellingOptionsManager(mo0_0); SetStaticParametersVarInfoDefinitions(); SetPublisherData(); }
public Netradiationequivalentevaporation() { ModellingOptions mo0_0 = new ModellingOptions(); //Parameters List <VarInfo> _parameters0_0 = new List <VarInfo>(); VarInfo v1 = new VarInfo(); v1.DefaultValue = 2.454; v1.Description = "latent heat of vaporization of water"; v1.Id = 0; v1.MaxValue = 10; v1.MinValue = 0; v1.Name = "lambdaV"; v1.Size = 1; v1.Units = "MJ kg-1"; v1.URL = ""; v1.VarType = CRA.ModelLayer.Core.VarInfo.Type.PARAMETER; v1.ValueType = VarInfoValueTypes.GetInstanceForName("Double"); _parameters0_0.Add(v1); mo0_0.Parameters = _parameters0_0; //Inputs List <PropertyDescription> _inputs0_0 = new List <PropertyDescription>(); PropertyDescription pd1 = new PropertyDescription(); pd1.DomainClassType = typeof(SiriusQualityEnergybalance.DomainClass.EnergybalanceAuxiliary); pd1.PropertyName = "netRadiation"; pd1.PropertyType = (SiriusQualityEnergybalance.DomainClass.EnergybalanceAuxiliaryVarInfo.netRadiation).ValueType.TypeForCurrentValue; pd1.PropertyVarInfo = (SiriusQualityEnergybalance.DomainClass.EnergybalanceAuxiliaryVarInfo.netRadiation); _inputs0_0.Add(pd1); mo0_0.Inputs = _inputs0_0; //Outputs List <PropertyDescription> _outputs0_0 = new List <PropertyDescription>(); PropertyDescription pd2 = new PropertyDescription(); pd2.DomainClassType = typeof(SiriusQualityEnergybalance.DomainClass.EnergybalanceAuxiliary); pd2.PropertyName = "netRadiationEquivalentEvaporation"; pd2.PropertyType = (SiriusQualityEnergybalance.DomainClass.EnergybalanceAuxiliaryVarInfo.netRadiationEquivalentEvaporation).ValueType.TypeForCurrentValue; pd2.PropertyVarInfo = (SiriusQualityEnergybalance.DomainClass.EnergybalanceAuxiliaryVarInfo.netRadiationEquivalentEvaporation); _outputs0_0.Add(pd2); mo0_0.Outputs = _outputs0_0; //Associated strategies List <string> lAssStrat0_0 = new List <string>(); mo0_0.AssociatedStrategies = lAssStrat0_0; //Adding the modeling options to the modeling options manager _modellingOptionsManager = new ModellingOptionsManager(mo0_0); SetStaticParametersVarInfoDefinitions(); SetPublisherData(); }
public SnowDepthTrans() { ModellingOptions mo0_0 = new ModellingOptions(); //Parameters List <VarInfo> _parameters0_0 = new List <VarInfo>(); VarInfo v1 = new VarInfo(); v1.DefaultValue = 100.0; v1.Description = "density of the new snow"; v1.Id = 0; v1.MaxValue =; v1.MinValue =; v1.Name = "Pns"; v1.Size = 1; v1.Units = "cm/m"; v1.URL = ""; v1.VarType = CRA.ModelLayer.Core.VarInfo.Type.PARAMETER; v1.ValueType = VarInfoValueTypes.GetInstanceForName("Double"); _parameters0_0.Add(v1); mo0_0.Parameters = _parameters0_0; //Inputs List <PropertyDescription> _inputs0_0 = new List <PropertyDescription>(); PropertyDescription pd1 = new PropertyDescription(); pd1.DomainClassType = typeof(SiriusQualitySnow.DomainClass.SnowState); pd1.PropertyName = "Sdepth"; pd1.PropertyType = (SiriusQualitySnow.DomainClass.SnowStateVarInfo.Sdepth).ValueType.TypeForCurrentValue; pd1.PropertyVarInfo = (SiriusQualitySnow.DomainClass.SnowStateVarInfo.Sdepth); _inputs0_0.Add(pd1); mo0_0.Inputs = _inputs0_0; //Outputs List <PropertyDescription> _outputs0_0 = new List <PropertyDescription>(); PropertyDescription pd2 = new PropertyDescription(); pd2.DomainClassType = typeof(SiriusQualitySnow.DomainClass.SnowState); pd2.PropertyName = "Sdepth_cm"; pd2.PropertyType = (SiriusQualitySnow.DomainClass.SnowStateVarInfo.Sdepth_cm).ValueType.TypeForCurrentValue; pd2.PropertyVarInfo = (SiriusQualitySnow.DomainClass.SnowStateVarInfo.Sdepth_cm); _outputs0_0.Add(pd2); mo0_0.Outputs = _outputs0_0; //Associated strategies List <string> lAssStrat0_0 = new List <string>(); mo0_0.AssociatedStrategies = lAssStrat0_0; //Adding the modeling options to the modeling options manager _modellingOptionsManager = new ModellingOptionsManager(mo0_0); SetStaticParametersVarInfoDefinitions(); SetPublisherData(); }
public Soilheatflux() { ModellingOptions mo0_0 = new ModellingOptions(); //Parameters List <VarInfo> _parameters0_0 = new List <VarInfo>(); VarInfo v1 = new VarInfo(); v1.DefaultValue = 0.9983; v1.Description = "plant cover factor"; v1.Id = 0; v1.MaxValue = 100; v1.MinValue = 0; v1.Name = "tau"; v1.Size = 1; v1.Units = ""; v1.URL = ""; v % s.VarType = CRA.ModelLayer.Core.VarInfo.Type.STATE; v1.ValueType = VarInfoValueTypes.GetInstanceForName("DOUBLE"); _parameters0_0.Add(v1); mo0_0.Parameters = _parameters0_0; //Inputs List <PropertyDescription> _inputs0_0 = new List <PropertyDescription>(); PropertyDescription pd1 = new PropertyDescription(); pd1.DomainClassType = typeof(SiriusQualityEnergybalance.EnergybalanceState); pd1.PropertyName = "netRadiationEquivalentEvaporation"; pd1.PropertyType = ((SiriusQualityEnergybalance.EnergybalanceStateVarInfo.netRadiationEquivalentEvaporation)).ValueType.TypeForCurrentValue; pd1.PropertyVarInfo = (SiriusQualityEnergybalance.EnergybalanceStateVarInfo.netRadiationEquivalentEvaporation); _inputs0_0.Add(pd1); PropertyDescription pd2 = new PropertyDescription(); pd2.DomainClassType = typeof(SiriusQualityEnergybalance.EnergybalanceState); pd2.PropertyName = "soilEvaporation"; pd2.PropertyType = ((SiriusQualityEnergybalance.EnergybalanceStateVarInfo.soilEvaporation)).ValueType.TypeForCurrentValue; pd2.PropertyVarInfo = (SiriusQualityEnergybalance.EnergybalanceStateVarInfo.soilEvaporation); _inputs0_0.Add(pd2); mo0_0.Inputs = _inputs0_0; //Outputs List <PropertyDescription> _outputs0_0 = new List <PropertyDescription>(); PropertyDescription pd3 = new PropertyDescription(); pd3.DomainClassType = typeof(SiriusQualityEnergybalance.EnergybalanceRate); pd3.PropertyName = "soilHeatFlux"; pd3.PropertyType = ((SiriusQualityEnergybalance.EnergybalanceRateVarInfo.soilHeatFlux)).ValueType.TypeForCurrentValue; pd3.PropertyVarInfo = (SiriusQualityEnergybalance.EnergybalanceRateVarInfo.soilHeatFlux); _outputs0_0.Add(pd3); mo0_0.Outputs = _outputs0_0; }
public Evapotranspiration() { ModellingOptions mo0_0 = new ModellingOptions(); //Parameters List <VarInfo> _parameters0_0 = new List <VarInfo>(); VarInfo v1 = new VarInfo(); v1.DefaultValue = 1; v1.Description = "if wind and vapour pressure are defined"; v1.Id = 0; v1.MaxValue = 1; v1.MinValue = 0; v1.Name = "isWindVpDefined"; v1.Size = 1; v1.Units = ""; v1.URL = ""; v % s.VarType = CRA.ModelLayer.Core.VarInfo.Type.STATE; v1.ValueType = VarInfoValueTypes.GetInstanceForName("INT"); _parameters0_0.Add(v1); mo0_0.Parameters = _parameters0_0; //Inputs List <PropertyDescription> _inputs0_0 = new List <PropertyDescription>(); PropertyDescription pd1 = new PropertyDescription(); pd1.DomainClassType = typeof(SiriusQualityEnergybalance.EnergybalanceRate); pd1.PropertyName = "evapoTranspirationPriestlyTaylor"; pd1.PropertyType = ((SiriusQualityEnergybalance.EnergybalanceRateVarInfo.evapoTranspirationPriestlyTaylor)).ValueType.TypeForCurrentValue; pd1.PropertyVarInfo = (SiriusQualityEnergybalance.EnergybalanceRateVarInfo.evapoTranspirationPriestlyTaylor); _inputs0_0.Add(pd1); PropertyDescription pd2 = new PropertyDescription(); pd2.DomainClassType = typeof(SiriusQualityEnergybalance.EnergybalanceRate); pd2.PropertyName = "evapoTranspirationPenman"; pd2.PropertyType = ((SiriusQualityEnergybalance.EnergybalanceRateVarInfo.evapoTranspirationPenman)).ValueType.TypeForCurrentValue; pd2.PropertyVarInfo = (SiriusQualityEnergybalance.EnergybalanceRateVarInfo.evapoTranspirationPenman); _inputs0_0.Add(pd2); mo0_0.Inputs = _inputs0_0; //Outputs List <PropertyDescription> _outputs0_0 = new List <PropertyDescription>(); PropertyDescription pd3 = new PropertyDescription(); pd3.DomainClassType = typeof(SiriusQualityEnergybalance.EnergybalanceRate); pd3.PropertyName = "evapoTranspiration"; pd3.PropertyType = ((SiriusQualityEnergybalance.EnergybalanceRateVarInfo.evapoTranspiration)).ValueType.TypeForCurrentValue; pd3.PropertyVarInfo = (SiriusQualityEnergybalance.EnergybalanceRateVarInfo.evapoTranspiration); _outputs0_0.Add(pd3); mo0_0.Outputs = _outputs0_0; }
/// <summary> /// Returns a VarInfo current value given its name from an IEnumerable of VarInfo objects. If the IEnumerable<VarInfo> contains many parameters with the specified name, only the value of the first one will be returned. /// If the IEnumerable<VarInfo> contains no parameter with the specified name, an exception is thrown /// </summary> /// <param name="parameters">The IEnumerable of VarInfo</param> /// <param name="varInfoName">The name of the VarInfo to return</param> /// <returns></returns> public static object GetParameterCurrentValueByName(this IEnumerable <VarInfo> parameters, string varInfoName) { if (string.IsNullOrEmpty(varInfoName)) { throw new Exception("Requested parameter with an empty name."); } VarInfo parameterByName = parameters.GetParameterByName(varInfoName); if (parameterByName == null) { throw new Exception("No parameter with name '" + varInfoName + "' found in the collection of parameters."); } return(parameterByName.CurrentValue); }
public CalculateGlobalAbsorbedRadiationDailyLayers() { ModellingOptions mo0_0 = new ModellingOptions(); //Parameters List <VarInfo> _parameters0_0 = new List <VarInfo>(); VarInfo v1 = new VarInfo(); v1.DefaultValue = 1; v1.Description = "Extinction coefficient of PAR irradiance through the canopy (no distinction between direct and diffuse fractions)"; v1.Id = 0; v1.MaxValue = 10; v1.MinValue = 0; v1.Name = "Kl"; v1.Size = 1; v1.Units = "-"; v1.URL = ""; v1.VarType = CRA.ModelLayer.Core.VarInfo.Type.STATE; v1.ValueType = VarInfoValueTypes.GetInstanceForName("Double"); _parameters0_0.Add(v1); mo0_0.Parameters = _parameters0_0; //Inputs List <PropertyDescription> _inputs0_0 = new List <PropertyDescription>(); PropertyDescription pd1 = new PropertyDescription(); pd1.DomainClassType = typeof(INRA.SiriusQualityIrradiance.Interfaces.Rates); pd1.PropertyName = "absorbedGlobalIrradianceLayeredHourly"; pd1.PropertyType = ((INRA.SiriusQualityIrradiance.Interfaces.RatesVarInfo.absorbedGlobalIrradianceLayeredHourly)).ValueType.TypeForCurrentValue; pd1.PropertyVarInfo = (INRA.SiriusQualityIrradiance.Interfaces.RatesVarInfo.absorbedGlobalIrradianceLayeredHourly); _inputs0_0.Add(pd1); mo0_0.Inputs = _inputs0_0; //Outputs List <PropertyDescription> _outputs0_0 = new List <PropertyDescription>(); PropertyDescription pd2 = new PropertyDescription(); pd2.DomainClassType = typeof(INRA.SiriusQualityIrradiance.Interfaces.Rates); pd2.PropertyName = "absorbedGlobalIrradiance"; pd2.PropertyType = ((INRA.SiriusQualityIrradiance.Interfaces.RatesVarInfo.absorbedGlobalIrradiance)).ValueType.TypeForCurrentValue; pd2.PropertyVarInfo = (INRA.SiriusQualityIrradiance.Interfaces.RatesVarInfo.absorbedGlobalIrradiance); _outputs0_0.Add(pd2); mo0_0.Outputs = _outputs0_0; //Associated strategies List <string> lAssStrat0_0 = new List <string>(); mo0_0.AssociatedStrategies = lAssStrat0_0; //Adding the modeling options to the modeling options manager _modellingOptionsManager = new ModellingOptionsManager(mo0_0); SetStaticParametersVarInfoDefinitions(); SetPublisherData(); }
private string Greater(VarInfo i, double[] v) { string str = string.Empty; string str2 = string.Empty; for (int j = 0; j < v.GetLength(0); j++) { if (v[j] > i.MaxValue) { str2 = string.Concat(new object[] { i.Name, "[", j.ToString(), "] = ", v[j].ToString(), " (max=", i.MaxValue, " - min=", i.MinValue, ") ", this._callID, ";\r\n" }); str = str + str2; } } return(str); }
/// <summary> /// Builds the instance of this condition. It requires two VarInfo to be used in the test /// </summary> /// <param name="firstVarInfo"></param> /// <param name="secondVarInfo"></param> public NotZeroIfSecondNotZeroCondition(VarInfo firstVarInfo, VarInfo secondVarInfo) { if (firstVarInfo == null) { throw new ArgumentNullException("firstVarInfo"); } if (secondVarInfo == null) { throw new ArgumentNullException("secondVarInfo"); } this._firstVarInfo = firstVarInfo; this._secondVarInfo = secondVarInfo; this._controlledVarInfos = new List <VarInfo> { this._firstVarInfo, this._secondVarInfo }; }
private string AtLeast(VarInfo i, double[] vvector) { string str = ""; bool flag = false; for (int j = 0; j < vvector.GetLength(0); j++) { if ((vvector[j] > 0.0) || (vvector[j] < 0.0)) { flag = true; } } if (!flag) { str = string.Concat(new object[] { "all ", i.Name, "[ ] = ", 0, " (at least one should have been different from 0) ", this._callID, ";\r\n" }); } return(str); }
private string Smaller(VarInfo i, double[,] v) { string str = string.Empty; string str2 = string.Empty; for (int j = 0; j < v.GetLength(0); j++) { for (int k = 0; k < v.GetLength(1); k++) { if (v[j, k] < i.MinValue) { str2 = string.Concat(new object[] { i.Name, "[", j.ToString(), ",", k.ToString(), "] = ", v[j, k].ToString(), "] (max=", i.MaxValue, " - min=", i.MinValue, ") ", this._callID, ";\r\n" }); str = str + str2; } } } return(str); }
public Netradiationequivalentevaporation() { ModellingOptions mo0_0 = new ModellingOptions(); //Parameters List <VarInfo> _parameters0_0 = new List <VarInfo>(); VarInfo v1 = new VarInfo(); v1.DefaultValue = 2.454; v1.Description = "latent heat of vaporization of water"; v1.Id = 0; v1.MaxValue = 10; v1.MinValue = 0; v1.Name = "lambdaV"; v1.Size = 1; v1.Units = "MJ kg-1"; v1.URL = ""; v % s.VarType = CRA.ModelLayer.Core.VarInfo.Type.STATE; v1.ValueType = VarInfoValueTypes.GetInstanceForName("DOUBLE"); _parameters0_0.Add(v1); mo0_0.Parameters = _parameters0_0; //Inputs List <PropertyDescription> _inputs0_0 = new List <PropertyDescription>(); PropertyDescription pd1 = new PropertyDescription(); pd1.DomainClassType = typeof(SiriusQualityEnergybalance.EnergybalanceState); pd1.PropertyName = "netRadiation"; pd1.PropertyType = ((SiriusQualityEnergybalance.EnergybalanceStateVarInfo.netRadiation)).ValueType.TypeForCurrentValue; pd1.PropertyVarInfo = (SiriusQualityEnergybalance.EnergybalanceStateVarInfo.netRadiation); _inputs0_0.Add(pd1); mo0_0.Inputs = _inputs0_0; //Outputs List <PropertyDescription> _outputs0_0 = new List <PropertyDescription>(); PropertyDescription pd2 = new PropertyDescription(); pd2.DomainClassType = typeof(SiriusQualityEnergybalance.EnergybalanceAuxiliary); pd2.PropertyName = "netRadiationEquivalentEvaporation"; pd2.PropertyType = ((SiriusQualityEnergybalance.EnergybalanceAuxiliaryVarInfo.netRadiationEquivalentEvaporation)).ValueType.TypeForCurrentValue; pd2.PropertyVarInfo = (SiriusQualityEnergybalance.EnergybalanceAuxiliaryVarInfo.netRadiationEquivalentEvaporation); _outputs0_0.Add(pd2); mo0_0.Outputs = _outputs0_0; }
public Diffusionlimitedevaporation() { ModellingOptions mo0_0 = new ModellingOptions(); //Parameters List <VarInfo> _parameters0_0 = new List <VarInfo>(); VarInfo v1 = new VarInfo(); v1.DefaultValue = 4.2; v1.Description = "soil Diffusion Constant"; v1.Id = 0; v1.MaxValue = 10; v1.MinValue = 0; v1.Name = "soilDiffusionConstant"; v1.Size = 1; v1.Units = ""; v1.URL = ""; v % s.VarType = CRA.ModelLayer.Core.VarInfo.Type.STATE; v1.ValueType = VarInfoValueTypes.GetInstanceForName("DOUBLE"); _parameters0_0.Add(v1); mo0_0.Parameters = _parameters0_0; //Inputs List <PropertyDescription> _inputs0_0 = new List <PropertyDescription>(); PropertyDescription pd1 = new PropertyDescription(); pd1.DomainClassType = typeof(SiriusQualityEnergybalance.EnergybalanceAuxiliary); pd1.PropertyName = "deficitOnTopLayers"; pd1.PropertyType = ((SiriusQualityEnergybalance.EnergybalanceAuxiliaryVarInfo.deficitOnTopLayers)).ValueType.TypeForCurrentValue; pd1.PropertyVarInfo = (SiriusQualityEnergybalance.EnergybalanceAuxiliaryVarInfo.deficitOnTopLayers); _inputs0_0.Add(pd1); mo0_0.Inputs = _inputs0_0; //Outputs List <PropertyDescription> _outputs0_0 = new List <PropertyDescription>(); PropertyDescription pd2 = new PropertyDescription(); pd2.DomainClassType = typeof(SiriusQualityEnergybalance.EnergybalanceState); pd2.PropertyName = "diffusionLimitedEvaporation"; pd2.PropertyType = ((SiriusQualityEnergybalance.EnergybalanceStateVarInfo.diffusionLimitedEvaporation)).ValueType.TypeForCurrentValue; pd2.PropertyVarInfo = (SiriusQualityEnergybalance.EnergybalanceStateVarInfo.diffusionLimitedEvaporation); _outputs0_0.Add(pd2); mo0_0.Outputs = _outputs0_0; }
public PriestlyTaylor() { ModellingOptions mo0_0 = new ModellingOptions(); //Parameters List <VarInfo> _parameters0_0 = new List <VarInfo>(); VarInfo v1 = new VarInfo(); v1.DefaultValue = 0.66; v1.Description = "psychrometric constant"; v1.Id = 0; v1.MaxValue = 1; v1.MinValue = 0; v1.Name = "psychrometricConstant"; v1.Size = 1; v1.Units = ""; v1.URL = ""; v1.VarType = CRA.ModelLayer.Core.VarInfo.Type.PARAMETER; v1.ValueType = VarInfoValueTypes.GetInstanceForName("Double"); _parameters0_0.Add(v1); VarInfo v2 = new VarInfo(); v2.DefaultValue = 1.5; v2.Description = "Priestley-Taylor evapotranspiration proportionality constant"; v2.Id = 0; v2.MaxValue = 100; v2.MinValue = 0; v2.Name = "Alpha"; v2.Size = 1; v2.Units = ""; v2.URL = ""; v2.VarType = CRA.ModelLayer.Core.VarInfo.Type.PARAMETER; v2.ValueType = VarInfoValueTypes.GetInstanceForName("Double"); _parameters0_0.Add(v2); mo0_0.Parameters = _parameters0_0; //Inputs List <PropertyDescription> _inputs0_0 = new List <PropertyDescription>(); PropertyDescription pd1 = new PropertyDescription(); pd1.DomainClassType = typeof(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceState); pd1.PropertyName = "netRadiationEquivalentEvaporation"; pd1.PropertyType = (SiriusQualityEnergyBalance.DomainClass.EnergyBalanceStateVarInfo.netRadiationEquivalentEvaporation).ValueType.TypeForCurrentValue; pd1.PropertyVarInfo = (SiriusQualityEnergyBalance.DomainClass.EnergyBalanceStateVarInfo.netRadiationEquivalentEvaporation); _inputs0_0.Add(pd1); PropertyDescription pd2 = new PropertyDescription(); pd2.DomainClassType = typeof(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliary); pd2.PropertyName = "hslope"; pd2.PropertyType = (SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliaryVarInfo.hslope).ValueType.TypeForCurrentValue; pd2.PropertyVarInfo = (SiriusQualityEnergyBalance.DomainClass.EnergyBalanceAuxiliaryVarInfo.hslope); _inputs0_0.Add(pd2); mo0_0.Inputs = _inputs0_0; //Outputs List <PropertyDescription> _outputs0_0 = new List <PropertyDescription>(); PropertyDescription pd3 = new PropertyDescription(); pd3.DomainClassType = typeof(SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRate); pd3.PropertyName = "evapoTranspirationPriestlyTaylor"; pd3.PropertyType = (SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRateVarInfo.evapoTranspirationPriestlyTaylor).ValueType.TypeForCurrentValue; pd3.PropertyVarInfo = (SiriusQualityEnergyBalance.DomainClass.EnergyBalanceRateVarInfo.evapoTranspirationPriestlyTaylor); _outputs0_0.Add(pd3); mo0_0.Outputs = _outputs0_0; //Associated strategies List <string> lAssStrat0_0 = new List <string>(); mo0_0.AssociatedStrategies = lAssStrat0_0; //Adding the modeling options to the modeling options manager _modellingOptionsManager = new ModellingOptionsManager(mo0_0); SetStaticParametersVarInfoDefinitions(); SetPublisherData(); }
public ShootNumber() { ModellingOptions mo0_0 = new ModellingOptions(); //Parameters List <VarInfo> _parameters0_0 = new List <VarInfo>(); VarInfo v1 = new VarInfo(); v1.DefaultValue = 288.0; v1.Description = "number of plant /m²"; v1.Id = 0; v1.MaxValue = 500; v1.MinValue = 0; v1.Name = "sowingDensity"; v1.Size = 1; v1.Units = "plant m-2"; v1.URL = ""; v1.VarType = CRA.ModelLayer.Core.VarInfo.Type.PARAMETER; v1.ValueType = VarInfoValueTypes.GetInstanceForName("Double"); _parameters0_0.Add(v1); VarInfo v2 = new VarInfo(); v2.DefaultValue = 600.0; v2.Description = "max value of shoot number for the canopy"; v2.Id = 0; v2.MaxValue = 1000; v2.MinValue = 280; v2.Name = "targetFertileShoot"; v2.Size = 1; v2.Units = "shoot"; v2.URL = ""; v2.VarType = CRA.ModelLayer.Core.VarInfo.Type.PARAMETER; v2.ValueType = VarInfoValueTypes.GetInstanceForName("Double"); _parameters0_0.Add(v2); mo0_0.Parameters = _parameters0_0; //Inputs List <PropertyDescription> _inputs0_0 = new List <PropertyDescription>(); PropertyDescription pd1 = new PropertyDescription(); pd1.DomainClassType = typeof(SiriusQualityPhenology.DomainClass.PhenologyState); pd1.PropertyName = "canopyShootNumber"; pd1.PropertyType = (SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.canopyShootNumber).ValueType.TypeForCurrentValue; pd1.PropertyVarInfo = (SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.canopyShootNumber); _inputs0_0.Add(pd1); PropertyDescription pd2 = new PropertyDescription(); pd2.DomainClassType = typeof(SiriusQualityPhenology.DomainClass.PhenologyState); pd2.PropertyName = "leafNumber"; pd2.PropertyType = (SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.leafNumber).ValueType.TypeForCurrentValue; pd2.PropertyVarInfo = (SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.leafNumber); _inputs0_0.Add(pd2); PropertyDescription pd3 = new PropertyDescription(); pd3.DomainClassType = typeof(SiriusQualityPhenology.DomainClass.PhenologyState); pd3.PropertyName = "tilleringProfile"; pd3.PropertyType = (SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.tilleringProfile).ValueType.TypeForCurrentValue; pd3.PropertyVarInfo = (SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.tilleringProfile); _inputs0_0.Add(pd3); PropertyDescription pd4 = new PropertyDescription(); pd4.DomainClassType = typeof(SiriusQualityPhenology.DomainClass.PhenologyState); pd4.PropertyName = "leafTillerNumberArray"; pd4.PropertyType = (SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.leafTillerNumberArray).ValueType.TypeForCurrentValue; pd4.PropertyVarInfo = (SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.leafTillerNumberArray); _inputs0_0.Add(pd4); PropertyDescription pd5 = new PropertyDescription(); pd5.DomainClassType = typeof(SiriusQualityPhenology.DomainClass.PhenologyState); pd5.PropertyName = "numberTillerCohort"; pd5.PropertyType = (SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.numberTillerCohort).ValueType.TypeForCurrentValue; pd5.PropertyVarInfo = (SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.numberTillerCohort); _inputs0_0.Add(pd5); mo0_0.Inputs = _inputs0_0; //Outputs List <PropertyDescription> _outputs0_0 = new List <PropertyDescription>(); PropertyDescription pd6 = new PropertyDescription(); pd6.DomainClassType = typeof(SiriusQualityPhenology.DomainClass.PhenologyState); pd6.PropertyName = "averageShootNumberPerPlant"; pd6.PropertyType = (SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.averageShootNumberPerPlant).ValueType.TypeForCurrentValue; pd6.PropertyVarInfo = (SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.averageShootNumberPerPlant); _outputs0_0.Add(pd6); mo0_0.Outputs = _outputs0_0; PropertyDescription pd7 = new PropertyDescription(); pd7.DomainClassType = typeof(SiriusQualityPhenology.DomainClass.PhenologyState); pd7.PropertyName = "canopyShootNumber"; pd7.PropertyType = (SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.canopyShootNumber).ValueType.TypeForCurrentValue; pd7.PropertyVarInfo = (SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.canopyShootNumber); _outputs0_0.Add(pd7); mo0_0.Outputs = _outputs0_0; PropertyDescription pd8 = new PropertyDescription(); pd8.DomainClassType = typeof(SiriusQualityPhenology.DomainClass.PhenologyState); pd8.PropertyName = "leafTillerNumberArray"; pd8.PropertyType = (SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.leafTillerNumberArray).ValueType.TypeForCurrentValue; pd8.PropertyVarInfo = (SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.leafTillerNumberArray); _outputs0_0.Add(pd8); mo0_0.Outputs = _outputs0_0; PropertyDescription pd9 = new PropertyDescription(); pd9.DomainClassType = typeof(SiriusQualityPhenology.DomainClass.PhenologyState); pd9.PropertyName = "tilleringProfile"; pd9.PropertyType = (SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.tilleringProfile).ValueType.TypeForCurrentValue; pd9.PropertyVarInfo = (SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.tilleringProfile); _outputs0_0.Add(pd9); mo0_0.Outputs = _outputs0_0; PropertyDescription pd10 = new PropertyDescription(); pd10.DomainClassType = typeof(SiriusQualityPhenology.DomainClass.PhenologyState); pd10.PropertyName = "numberTillerCohort"; pd10.PropertyType = (SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.numberTillerCohort).ValueType.TypeForCurrentValue; pd10.PropertyVarInfo = (SiriusQualityPhenology.DomainClass.PhenologyStateVarInfo.numberTillerCohort); _outputs0_0.Add(pd10); mo0_0.Outputs = _outputs0_0; //Associated strategies List <string> lAssStrat0_0 = new List <string>(); mo0_0.AssociatedStrategies = lAssStrat0_0; //Adding the modeling options to the modeling options manager _modellingOptionsManager = new ModellingOptionsManager(mo0_0); SetStaticParametersVarInfoDefinitions(); SetPublisherData(); }