//---------------------------------------------------------------------
 public static void CheckTemplateVars(string            template,
     SelectedDeadPools selectedPools)
 {
     if (selectedPools == (SelectedDeadPools.Woody | SelectedDeadPools.NonWoody))
         knownVars[PoolVar] = true;
     else
         knownVars[PoolVar] = false;
     OutputPath.CheckTemplateVars(template, knownVars);
 }
Ejemplo n.º 2
0
        //---------------------------------------------------------------------

        private void CheckDeadPools(IParameters parameters,
                                    SelectedDeadPools expectedPools,
                                    string expectedMapNames)
        {
            Assert.AreEqual(10, parameters.Timestep);

            Assert.IsNull(parameters.SelectedSpecies);
            Assert.IsNull(parameters.SpeciesMapNames);

            Assert.AreEqual(expectedPools, parameters.SelectedPools);
            Assert.AreEqual(expectedMapNames, parameters.PoolMapNames);
        }
        //---------------------------------------------------------------------
        public Parameters(int                   timestep,
		                  IEnumerable<ISpecies> selectedSpecies,
		                  string                speciesMapNames,
		                  SelectedDeadPools     selectedPools,
		                  string                poolMapNames)
        {
            this.timestep = timestep;
            this.selectedSpecies = selectedSpecies;
            this.speciesMapNames = speciesMapNames;
            this.selectedPools = selectedPools;
            this.poolMapNames = poolMapNames;
        }
        //---------------------------------------------------------------------
        public override void Initialize(string        dataFile,
            PlugIns.ICore modelCore)
        {
            this.modelCore = modelCore;

            ParametersParser parser = new ParametersParser(modelCore.Species);
            IParameters parameters = Data.Load<IParameters>(dataFile,
                                                            parser);

            Timestep = parameters.Timestep;
            this.selectedSpecies = parameters.SelectedSpecies;
            this.speciesMapNameTemplate = parameters.SpeciesMapNames;
            this.selectedPools = parameters.SelectedPools;
            this.poolMapNameTemplate = parameters.PoolMapNames;

            cohorts = modelCore.SuccessionCohorts as ILandscapeCohorts;
            if (cohorts == null)
                throw new ApplicationException("Error: Cohorts don't support biomass interface");
        }
        //---------------------------------------------------------------------
        private void CheckDeadPools(IParameters       parameters,
                                    SelectedDeadPools expectedPools,
                                    string            expectedMapNames)
        {
            Assert.AreEqual(10, parameters.Timestep);

            Assert.IsNull(parameters.SelectedSpecies);
            Assert.IsNull(parameters.SpeciesMapNames);

            Assert.AreEqual(expectedPools, parameters.SelectedPools);
            Assert.AreEqual(expectedMapNames, parameters.PoolMapNames);
        }