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

        public SingleRepeatHarvest(string               name,
                                   IStandRankingMethod  rankingMethod,
                                   ISiteSelector        siteSelector,
                                   ICohortSelector      cohortSelector,
                                   Planting.SpeciesList speciesToPlant,
                                   ICohortSelector      additionalCohortSelector,
                                   Planting.SpeciesList additionalSpeciesToPlant,
                                   int                  interval)
            : base(name, rankingMethod, siteSelector, cohortSelector, speciesToPlant, interval)
        {
            this.initialCohortSelector = cohortSelector;
            this.initialSpeciesToPlant = speciesToPlant;

            this.additionalCohortSelector = additionalCohortSelector;
            this.additionalSpeciesToPlant = additionalSpeciesToPlant;
        }
Пример #2
0
        //---------------------------------------------------------------------

        /// <summary>
        /// Schedules a list of species to be planted at a site.
        /// </summary>
        public static void ScheduleForPlanting(Planting.SpeciesList speciesToPlant,
                                               ActiveSite site)
        {
            planting.Schedule(speciesToPlant, site);
        }
        //---------------------------------------------------------------------

        public Prescription(string               name,
                            IStandRankingMethod  rankingMethod,
                            ISiteSelector        siteSelector,
                            ICohortSelector      cohortSelector,
                            Planting.SpeciesList speciesToPlant)
        {
            this.number = nextNumber;
            nextNumber++;

            this.name = name;
            this.rankingMethod = rankingMethod;
            this.siteSelector = siteSelector;
            this.cohortSelector = cohortSelector;
            this.speciesToPlant = speciesToPlant;
        }
        //---------------------------------------------------------------------

        public Prescription(string               name,
                            IStandRankingMethod  rankingMethod,
                            ISiteSelector        siteSelector,
                            ICohortSelector      cohortSelector,
                            Planting.SpeciesList speciesToPlant,
                            int                  minTimeSinceDamage,
                            bool                 preventEstablishment)
        {
            this.number = nextNumber;
            nextNumber++;

            this.name = name;
            this.rankingMethod = rankingMethod;
            this.siteSelector = siteSelector;
            this.cohortSelector = cohortSelector;
            this.speciesToPlant = speciesToPlant;
            this.minTimeSinceDamage = minTimeSinceDamage;
            this.preventEstablishment = preventEstablishment;
            
        }
        public void Planting()
        {
            // For readability
            Species.IDataset spp = core.Species;

            ISpecies[] speciesToPlant = new ISpecies[]{ spp[1], spp[4], spp[8] };
            Planting.SpeciesList plantingSpeciesList = new Planting.SpeciesList(speciesToPlant, core.Species);

            foreach (ActiveSite activeSite in landscape) {
                Reproduction.ScheduleForPlanting(plantingSpeciesList, activeSite);
            }
            
            // Don't expected seeding algorithm to be called since each active
            // set will be planted
            expectedSpecies.Clear();

            foreach (ActiveSite activeSite in landscape) {
                expectedSite = activeSite;
                actualSpecies_SeedingAlg.Clear();
                actualSpecies_AddNewCohort.Clear();

                if (activeSite.SharesData) {
                    if (activeSite.LocationInBlock == new Location(1,1)) {
                        SetList(speciesThatReproduce, speciesToPlant);
                    }
                    else {
                        // At all other active sites in the block, nothing else
                        // should reproduce (because first site in block had
                        // planting occur)
                        SetList(speciesThatReproduce);
                    }
                }
                else {
                    SetList(speciesThatReproduce, speciesToPlant);
                }
                Reproduction.Do(activeSite);

                Assert.AreEqual(expectedSpecies, actualSpecies_SeedingAlg);
                Assert.AreEqual(speciesThatReproduce, actualSpecies_AddNewCohort);
            }
        }