本文整理汇总了C#中IInputParameters类的典型用法代码示例。如果您正苦于以下问题:C# IInputParameters类的具体用法?C# IInputParameters怎么用?C# IInputParameters使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IInputParameters类属于命名空间,在下文中一共展示了IInputParameters类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
//private static StreamWriter log;
//---------------------------------------------------------------------
public static void Initialize(IInputParameters parameters)
{
FuncType = parameters.SppFunctionalType;
NFixer = parameters.NFixer;
GDDmin = parameters.GDDmin;
GDDmax = parameters.GDDmax;
MinJanTemp = parameters.MinJanTemp;
MaxDrought = parameters.MaxDrought;
LeafLongevity = parameters.LeafLongevity;
Epicormic = parameters.Epicormic;
LeafLignin = parameters.LeafLignin;
WoodLignin = parameters.WoodLignin ;
//CoarseRootLignin = parameters.CoarseRootLignin ;
//FineRootLignin = parameters.FineRootLignin ;
LeafCN = parameters.LeafCN;
WoodCN = parameters.WoodCN;
//CoarseRootCN = parameters.CoarseRootCN;
LeafLitterCN = parameters.FoliageLitterCN;
//FineRootCN = parameters.FineRootCN;
//NLimits = new Species.AuxParm<double>(PlugIn.ModelCore.Species);
Establishment.Initialize();
// The initial set of establishment probabilities:
EstablishProbability = Establishment.GenerateNewEstablishProbabilities(parameters.Timestep);
ChangeParameters(parameters);
}
示例2: LoadParameters
//---------------------------------------------------------------------
public override void LoadParameters(string dataFile, ICore mCore)
{
modelCore = mCore;
SiteVars.Initialize();
InputParameterParser parser = new InputParameterParser();
parameters = Landis.Data.Load<IInputParameters>(dataFile, parser);
}
示例3: Initialize
//---------------------------------------------------------------------
public static void Initialize(IInputParameters parameters)
{
string logFileName = "Century-succession-log.csv";
PlugIn.ModelCore.Log.WriteLine(" Opening Century-succession log file \"{0}\" ...", logFileName);
try {
log = new StreamWriter(logFileName);
}
catch (Exception err) {
string mesg = string.Format("{0}", err.Message);
throw new System.ApplicationException(mesg);
}
log.AutoFlush = true;
log.Write("Time, Ecoregion, NumSites,");
log.Write("NEEC, SOMTC, AGB, ");
log.Write("AG_NPPC, BG_NPPC, LitterfallC, AgeMortality, ");
log.Write("MineralN, TotalN, GrossMineralization, ");
log.Write("C:LeafFRoot, C:WoodCRoot, C:DeadWood, C:DeadCRoot, ");
log.Write("C:SurfStruc, C:SurfMeta, C:SoilStruc, C:SoilMeta, ");
log.Write("C:SOM1surf, C:SOM1soil, C:SOM2, C:SOM3, ");
log.Write("N:CohortLeaf, N:CohortWood, N:DeadWood, N:DeadRoot, ");
log.Write("N:SurfStruc, N:SurfMeta, N:SoilStruc, N:SoilMeta, ");
log.Write("N:SOM1surf, N:SOM1soil, N:SOM2, N:SOM3, ");
log.Write("SurfStrucNetMin, SurfMetaNetMin, SoilStrucNetMin, SoilMetaNetMin, ");
log.Write("SOM1surfNetMin, SOM1soilNetMin, SOM2NetMin, SOM3NetMin, ");
log.Write("StreamC, StreamN, FireCEfflux, FireNEfflux, ");
log.Write("Nuptake, Nresorbed, TotalSoilN, Nvol, avgfrassC,");
log.WriteLine("");
}
示例4: Initialize
//---------------------------------------------------------------------
public static void Initialize(IInputParameters parameters)
{
transpiration = PlugIn.ModelCore.Landscape.NewSiteVar<float>();
AnnualTranspiration = PlugIn.ModelCore.Landscape.NewSiteVar<float>();
infiltration = PlugIn.ModelCore.Landscape.NewSiteVar<float>();
runoff = PlugIn.ModelCore.Landscape.NewSiteVar<float>();
waterleakage = PlugIn.ModelCore.Landscape.NewSiteVar<float>();
evaporation = PlugIn.ModelCore.Landscape.NewSiteVar<float>();
WHC = parameters.WHC;
EvaporationFraction = parameters.EvaporationFraction;
LeakageFraction = parameters.LeakageFraction;
SnowPack = PlugIn.ModelCore.Landscape.NewSiteVar<float>();
Water = PlugIn.ModelCore.Landscape.NewSiteVar<float>();
foreach (ActiveSite site in PlugIn.ModelCore.Landscape)
{
SnowPack[site] = 0;
Water[site] = 0;
infiltration[site] = 0;
runoff[site] = 0;
evaporation[site] = 0;
transpiration[site] = 0;
AnnualTranspiration[site] = 0;
}
PlugIn.ModelCore.RegisterSiteVar(AnnualTranspiration, "Succession.AnnualTranspiration");
PlugIn.ModelCore.RegisterSiteVar(Water, "Succession.SoilWater");
}
示例5: LoadParameters
//---------------------------------------------------------------------
public override void LoadParameters(string dataFile,
ICore mCore)
{
modelCore = mCore;
InputParametersParser parser = new InputParametersParser();
parameters = modelCore.Load<IInputParameters>(dataFile, parser);
}
示例6: Initialize
public static void Initialize(IInputParameters parameters)
{
InitializeSpeciesParameters(parameters);
InitializeSiteVariables();
PlugIn.ModelCore.RegisterSiteVar(establishments, "Succession.Establishments");
}
示例7: LoadParameters
//---------------------------------------------------------------------
public override void LoadParameters(string dataFile, ICore mCore)
{
modelCore = mCore;
InputParametersParser.SpeciesDataset = modelCore.Species;
InputParametersParser parser = new InputParametersParser();
parameters = Landis.Data.Load<IInputParameters>(dataFile, parser);
}
示例8: Initialize
//---------------------------------------------------------------------
public static void Initialize(IInputParameters parameters)
{
RootTurnover = parameters.RootTurnover;
WoodTurnover = parameters.WoodTurnover;
FoliageTurnover = parameters.FoliageTurnover;
FolReten = parameters.FolReten;
LeafLignin = parameters.LeafLignin;
MortCurveShapeParm = parameters.MortCurveShapeParm;
GrowthCurveShapeParm = parameters.GrowthCurveShapeParm;
HalfSat = parameters.HalfSat;
EstRadSensitivity = parameters.EstRadSensitivity;
EstMoistureSensitivity = parameters.EstMoistureSensitivity;
PsnTOpt = parameters.PsnTOpt;
AmaxA = parameters.AmaxA;
AmaxB = parameters.AmaxB;
PsnTMin = parameters.PsnTMin;
DVPD1 = parameters.DVPD1;
DVPD2 = parameters.DVPD2;
FolNCon = parameters.FolNCon;
BaseFolRespFrac = parameters.BaseFolRespFrac;
GrowthMoistureSensitivity = parameters.GrowthMoistureSensitivity;
SLWmax = parameters.SLWmax;
k=parameters.K;
SenescStart = parameters.SenescStart;
WUEConst = parameters.WUEConst;
RespQ10 = parameters.RespQ10;
PsnAgeRed = parameters.PsnAgeRed;
InitialFol = parameters.InitialFol;
GDDFolStart = parameters.GDDFolStart;
DFol = parameters.DFol;
GRespFrac = parameters.GRespFrac;
DRoot = parameters.DRoot;
DStem = parameters.DStem;
}
示例9: LoadParameters
//---------------------------------------------------------------------
public override void LoadParameters(string dataFile, ICore mCore)
{
modelCore = mCore;
Landis.Library.HarvestManagement.Main.InitializeLib(modelCore);
InputParametersParser parser = new InputParametersParser(mCore.Species);
parameters = Landis.Data.Load<IInputParameters>(dataFile, parser);
if (parser.RoundedRepeatIntervals.Count > 0)
{
PlugIn.ModelCore.UI.WriteLine("NOTE: The following repeat intervals were rounded up to");
PlugIn.ModelCore.UI.WriteLine(" ensure they were multiples of the harvest timestep:");
PlugIn.ModelCore.UI.WriteLine(" File: {0}", dataFile);
foreach (RoundedInterval interval in parser.RoundedRepeatIntervals)
PlugIn.ModelCore.UI.WriteLine(" At line {0}, the interval {1} rounded up to {2}",
interval.LineNumber,
interval.Original,
interval.Adjusted);
}
if (parser.ParserNotes.Count > 0)
{
foreach (List<string> nList in parser.ParserNotes)
{
foreach (string nLine in nList)
{
PlugIn.ModelCore.UI.WriteLine(nLine);
}
}
}
}
示例10: InitializeClimData
public static void InitializeClimData(IInputParameters _parameters)
{
parameters = _parameters;
ReadContent();
SetFileProps();
Data = new DateVar<CClimDay>("ClimateData", FirstYearOnFile, LastYearOnFile);
for (int Year = FirstYearOnFile; Year < LastYearOnFile; Year++)
{
for(int Month = 1; Month <=12; Month++)
{
string line = GetLine(Year, Month);
string[] terms = line.Split(delim);
if (terms.Count() != ColumnCount)
{
throw new System.Exception("Unexpected number of columns in " + parameters.climateFileName + " (year,month) "+ Year +" "+ Month);
}
DateTime CurrentDate = new DateTime(Year, Month, 15);
float TMax = float.Parse(terms[TMaxCol]);
float TMin = float.Parse(terms[TMinCol]);
float CO2 = float.Parse(terms[CO2Col]);
float PAR0 = float.Parse(terms[PAR0col]);
float Prec = float.Parse(terms[Preccol]);
if (TMax < TMin) throw new System.Exception("Recheck climate data in " + parameters.climateFileName + " Tmax < Tmin on " + CurrentDate);
else if (Prec < 0) throw new System.Exception("Recheck climate data in " + parameters.climateFileName + " Prec = " + Prec + "\t" + CurrentDate);
Data[CurrentDate] = new CClimDay(parameters.Latitude, CurrentDate, PAR0, TMin, TMax, Prec, CO2);
}
}
}
示例11: LoadParameters
//---------------------------------------------------------------------
public override void LoadParameters(string dataFile,
ICore mCore)
{
ExtensionMain baseHarvest = new BaseHarvest.PlugIn();
try
{
baseHarvest.LoadParameters(null, mCore);
}
catch (System.ArgumentNullException)
{
// ignore
}
modelCore = mCore;
// Add local event handler for cohorts death due to age-only
// disturbances.
Landis.Library.LeafBiomassCohorts.Cohort.AgeOnlyDeathEvent += CohortKilledByAgeOnlyDisturbance;
InputParametersParser parser = new InputParametersParser(modelCore.Species);
BaseHarvest.IInputParameters baseParameters = Landis.Data.Load<BaseHarvest.IInputParameters>(dataFile, parser);
parameters = baseParameters as IInputParameters;
if (parser.RoundedRepeatIntervals.Count > 0)
{
modelCore.UI.WriteLine("NOTE: The following repeat intervals were rounded up to");
modelCore.UI.WriteLine(" ensure they were multiples of the harvest timestep:");
modelCore.UI.WriteLine(" File: {0}", dataFile);
foreach (RoundedInterval interval in parser.RoundedRepeatIntervals)
modelCore.UI.WriteLine(" At line {0}, the interval {1} rounded up to {2}",
interval.LineNumber,
interval.Original,
interval.Adjusted);
}
}
示例12: Initialize
//---------------------------------------------------------------------
public static void Initialize(IInputParameters parameters)
{
manyInsect = parameters.ManyInsect;
// Assign the method below to the CohortDefoliation delegate in
// biomass-cohorts/Biomass.CohortDefoliation.cs
Landis.Library.Biomass.CohortDefoliation.Compute = Defoliate.DefoliateCohort;
}
示例13: LoadParameters
//---------------------------------------------------------------------
public override void LoadParameters(string dataFile,
ICore mCore)
{
modelCore = mCore;
SiteVars.Initialize(mCore);
ParameterParser parser = new ParameterParser();
parameters = mCore.Load<IInputParameters>(dataFile, parser);
modelCore.Log.WriteLine("Exiting LoadParameters method !!!");
}
示例14: Initialize
//---------------------------------------------------------------------
public static void Initialize(IInputParameters parameters)
{
//ChangeParameters(parameters);
Drought_Y = parameters.Drought_Y;
Drought_YSE = parameters.Drought_YSE;
Drought_B = parameters.Drought_B;
Drought_BSE = parameters.Drought_BSE;
Drought_Sens = parameters.Drought_Sens;
}
示例15: Initialize
//---------------------------------------------------------------------
public static void Initialize(IInputParameters parameters)
{
foreach (ActiveSite site in Model.Core.Landscape)
{
IEcoregion ecoregion = Model.Core.Ecoregion[site];
SiteVars.Rock[site].ContentP = (parameters.InitialMineralP[ecoregion] * 0.99);
}
}