예제 #1
0
        //---------------------------------------------------------------------

        protected void WriteMapsForYear(string pathTemplate,
                                        int yearInTimestep,
                                        GetSpeciesValueAt getSpeciesValueAt)
        {
            int successionTimestep  = seedingData.time_step;
            int firstYearInTimestep = Model.Core.CurrentTime - successionTimestep + 1;
            int year = firstYearInTimestep + yearInTimestep;

            foreach (ISpecies species in Model.Core.Species)
            {
                string path = MapPaths.ReplaceTemplateVars(pathTemplate, year, species.Name);
                int    s    = species.Index;
                using (IOutputRaster <IntPixel> outputRaster = Model.Core.CreateRaster <IntPixel>(path, Model.Core.Landscape.Dimensions))
                {
                    IntPixel pixel = outputRaster.BufferPixel;
                    foreach (Site site in Model.Core.Landscape.AllSites)
                    {
                        int x = site.Location.Column - 1;
                        int y = site.Location.Row - 1;
                        pixel.Band0.Value = getSpeciesValueAt(x, y, s, yearInTimestep);
                        outputRaster.WriteBufferPixel();
                    }
                }
            }
        }
예제 #2
0
        //---------------------------------------------------------------------

        /// <summary>
        /// Write species maps for each year in the succession timestep.
        /// </summary>
        protected void WriteMapsForSuccessionTimestep(string pathTemplate,
                                                      GetSpeciesValueAt getSpeciesValueAt)
        {
            int successionTimestep  = seedingData.time_step;
            int firstYearInTimestep = Model.Core.CurrentTime - successionTimestep + 1;

            for (int t = 0; t < successionTimestep; t++)
            {
                WriteMapsForYear(pathTemplate, t, getSpeciesValueAt);
            }
        }