//---------------------------------------------------------------------


        /// <summary>
        /// Initializes the instance and its associated site variables.
        /// </summary>
        protected void Initialize(ICore modelCore,
                                  SeedingAlgorithms seedAlg)
        {
            Model.Core = modelCore;
            SiteVars.Initialize();
            Seeding.InitializeMaxSeedNeighborhood();

            disturbedSites = new DisturbedSiteEnumerator(Model.Core.Landscape,
                                                         SiteVars.Disturbed);

            SeedingAlgorithm algorithm;

            switch (seedAlg)
            {
            case SeedingAlgorithms.NoDispersal:
                algorithm = NoDispersal.Algorithm;
                break;

            case SeedingAlgorithms.UniversalDispersal:
                algorithm = UniversalDispersal.Algorithm;
                break;

            case SeedingAlgorithms.WardSeedDispersal:
                algorithm = WardSeedDispersal.Algorithm;
                break;

            default:
                throw new ArgumentException(string.Format("Unknown seeding algorithm: {0}", seedAlg));
            }

            Reproduction.Initialize(algorithm);
        }
예제 #2
0
        //---------------------------------------------------------------------


        /// <summary>
        /// Initializes the instance and its associated site variables.
        /// </summary>
        protected void Initialize(PlugIns.ICore modelCore,
                                  double[,] establishProbabilities,
                                  SeedingAlgorithms seedAlg,
                                  Reproduction.Delegates.AddNewCohort addNewCohort)
        {
            Model.Core = modelCore;
            SiteVars.Initialize();
            Seeding.InitializeMaxSeedNeighborhood();

            disturbedSites = new DisturbedSiteEnumerator(Model.Core.Landscape,
                                                         SiteVars.Disturbed);

            SeedingAlgorithm algorithm;

            switch (seedAlg)
            {
            case SeedingAlgorithms.NoDispersal:
                algorithm = NoDispersal.Algorithm;
                break;

            case SeedingAlgorithms.UniversalDispersal:
                algorithm = UniversalDispersal.Algorithm;
                break;

            case SeedingAlgorithms.WardSeedDispersal:
                algorithm = WardSeedDispersal.Algorithm;
                break;

            default:
                throw new ArgumentException(string.Format("Unknown seeding algorithm: {0}", seedAlg));
            }

            Reproduction.Initialize(establishProbabilities, algorithm,
                                    addNewCohort == null ? null : new Reproduction.Delegates.AddNewCohort(addNewCohort));
        }
예제 #3
0
        //---------------------------------------------------------------------

        //public static void Initialize(double[,]              establishProbabilities,
        public static void Initialize(SeedingAlgorithm seedingAlgorithm,
                                      Delegates.AddNewCohort addNewCohort)
        {
            // Reproduction.establishProbabilities = establishProbabilities;

            seeding = new Seeding(seedingAlgorithm);
            Reproduction.addNewCohort = addNewCohort;

            SiteVars.Cohorts = Model.Core.GetSiteVar <SiteCohorts>("Succession.Cohorts");

            speciesDataset = Model.Core.Species;
            int speciesCount = speciesDataset.Count;

            resprout    = Model.Core.Landscape.NewSiteVar <BitArray>();
            serotiny    = Model.Core.Landscape.NewSiteVar <BitArray>();
            noEstablish = Model.Core.Landscape.NewSiteVar <bool>();
            foreach (ActiveSite site in Model.Core.Landscape.ActiveSites)
            {
                resprout[site] = new BitArray(speciesCount);
                serotiny[site] = new BitArray(speciesCount);
            }

            noEstablish.ActiveSiteValues = false;
            planting = new Planting();
        }
예제 #4
0
        //---------------------------------------------------------------------


        /// <summary>
        /// Initializes the instance and its associated site variables.
        /// </summary>
        protected void Initialize(ICore modelCore,
                                  SeedingAlgorithms seedAlg)//,
        //Reproduction.Delegates.AddNewCohort addNewCohort)
        {
            Model.Core = modelCore;
            SiteVars.Initialize();
            Seeding.InitializeMaxSeedNeighborhood();

            disturbedSites = new DisturbedSiteEnumerator(Model.Core.Landscape,
                                                         SiteVars.Disturbed);

            SeedingAlgorithm algorithm = SeedingAlgorithmsUtil.GetAlgorithm(seedAlg,
                                                                            Timestep);

            Reproduction.Initialize(algorithm);
        }
        //---------------------------------------------------------------------

        public static void Initialize(SeedingAlgorithm seedingAlgorithm)
        {
            seeding = new Seeding(seedingAlgorithm);

            speciesDataset = Model.Core.Species;
            int speciesCount = speciesDataset.Count;

            resprout    = Model.Core.Landscape.NewSiteVar <BitArray>();
            serotiny    = Model.Core.Landscape.NewSiteVar <BitArray>();
            noEstablish = Model.Core.Landscape.NewSiteVar <bool>();
            foreach (ActiveSite site in Model.Core.Landscape.ActiveSites)
            {
                resprout[site] = new BitArray(speciesCount);
                serotiny[site] = new BitArray(speciesCount);
            }

            noEstablish.ActiveSiteValues = false;
            planting = new Planting();
        }