コード例 #1
0
        //---------------------------------------------------------------------

        public static Species.AuxParm <Ecoregions.AuxParm <T> > CreateSpeciesEcoregionParm <T>(ISpeciesDataset speciesDataset, IEcoregionDataset ecoregionDataset)
        {
            Species.AuxParm <Ecoregions.AuxParm <T> > newParm;
            newParm = new Species.AuxParm <Ecoregions.AuxParm <T> >(speciesDataset);
            foreach (ISpecies species in speciesDataset)
            {
                newParm[species] = new Ecoregions.AuxParm <T>(ecoregionDataset);
            }
            return(newParm);
        }
コード例 #2
0
        //---------------------------------------------------------------------

        /// <summary>
        /// Converts a table indexed by species and ecoregion into a
        /// 2-dimensional array.
        /// </summary>
        public static T[,] ToArray <T>(Species.AuxParm <Ecoregions.AuxParm <T> > table)
        {
            T[,] array = new T[PlugIn.ModelCore.Ecoregions.Count, PlugIn.ModelCore.Species.Count];
            foreach (ISpecies species in PlugIn.ModelCore.Species)
            {
                foreach (IEcoregion ecoregion in PlugIn.ModelCore.Ecoregions)
                {
                    array[ecoregion.Index, species.Index] = table[species][ecoregion];
                }
            }
            return(array);
        }