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

        /// <summary>
        /// Harvests the stands that have repeat harvests scheduled for the
        /// current time step.
        /// </summary>
        public void HarvestReservedStands()
        {
            while (reservedStands.Count > 0 &&
                   reservedStands.Peek().NextTimeToHarvest <= Model.Core.CurrentTime)
            {
                //Stand stand = reservedStands.Dequeue().Stand;
                Stand stand = reservedStands.Peek().Stand;

                repeatHarvest.Harvest(stand);

                stand = reservedStands.Dequeue().Stand;

                if (isMultipleRepeatHarvest)
                {
                    ScheduleNextHarvest(stand);
                }
            }
        }
示例#2
0
        //---------------------------------------------------------------------

        /// <summary>
        /// Harvests the stands that have repeat harvests scheduled for the
        /// current time step.
        /// </summary>
        public void HarvestReservedStands()
        {
            while (reservedStands.Count > 0 &&
                   reservedStands.Peek().NextTimeToHarvest <= Model.Core.CurrentTime)
            {
                //Stand stand = reservedStands.Dequeue().Stand;

                Stand stand = reservedStands.Peek().Stand;

                uint repeat = stand.RepeatNumber;

                repeatHarvest.Harvest(stand);

                stand.SetRepeatHarvested();

                stand.IncrementRepeat();

                HarvestExtensionMain.OnRepeatStandHarvest(this, stand, stand.RepeatNumber);

                stand = reservedStands.Dequeue().Stand;

                // Record every instance of a repeat harvest
                if (reservedStands.Count > 0 && reservedStands.Peek().Stand.RepeatNumber != repeat)
                {
                    HarvestExtensionMain.OnRepeatHarvestFinished(this, this, this.ActiveMgmtArea, repeat + 1, false);
                }
                else if (reservedStands.Count == 0 || reservedStands.Peek().NextTimeToHarvest > Model.Core.CurrentTime)
                {
                    HarvestExtensionMain.OnRepeatHarvestFinished(this, this, this.ActiveMgmtArea, repeat + 1, true);
                }

                if (isMultipleRepeatHarvest)
                {
                    ScheduleNextHarvest(stand);
                }
                else
                {
                    stand.ResetRepeatNumber();
                }
            }
        }