Exemplo n.º 1
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));
        }
Exemplo n.º 2
0
        //---------------------------------------------------------------------

        /// <summary>
        /// Initializes the instance and its associated site variables.
        /// </summary>
        protected void Initialize(int timestep,
                                  double[,]                       establishProbabilities,
                                  int startTime,
                                  SeedingAlgorithms seedAlg,
                                  Reproduction.AddNewCohortMethod addNewCohort)
        {
            this.timestep            = timestep;
            this.nextTimeToRun       = startTime - 1 + timestep;
            this.updateNextTimeToRun = false;

            SiteVars.Initialize();

            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);
        }
        //---------------------------------------------------------------------

        /// <summary>
        /// Initializes the instance and its associated site variables.
        /// </summary>
        protected void Initialize(int timestep,
                                  double[,] establishProbabilities)
        {
            this.timestep      = timestep;
            this.nextTimeToRun = timestep;

            SiteVars.Initialize();
            SiteVars.Reproduction.ActiveSiteValues = new ReproductionBySeeding(new UniversalSeeding());
            Reproduction.SetEstablishProbabilities(establishProbabilities);
        }
        //---------------------------------------------------------------------

        /// <summary>
        /// Initializes the instance and its associated site variables.
        /// </summary>
        protected void Initialize(int timestep,
                                  double[,] establishProbabilities)
        {
            this.timestep      = timestep;
            this.nextTimeToRun = timestep;

            SiteVars.Initialize();
            defaultReproduction = new Seeding(WardSeedDispersal.Algorithm);
            SiteVars.Reproduction.ActiveSiteValues = defaultReproduction;
            Reproduction.SetEstablishProbabilities(establishProbabilities);
        }