Ejemplo n.º 1
0
        //---------------------------------------------------------------------

        private void LogEvent(int   currentTime,
                              Event windEvent)
        {
            //log.WriteLine("{0},\"{1}\",{2},{3},{4},{5:0.0}",
            //              currentTime,
            //              windEvent.StartLocation,
            //              windEvent.Size,
            //              windEvent.SitesDamaged,
            //              windEvent.CohortsKilled,
            //              windEvent.Severity);

            eventLog.Clear();
            EventsLog el = new EventsLog();
            el.Time = currentTime;
            el.InitRow = windEvent.StartLocation.Row;
            el.InitColumn = windEvent.StartLocation.Column;
            el.TotalSites = windEvent.Size;
            el.DamagedSites = windEvent.SitesDamaged;
            el.CohortsKilled = windEvent.CohortsKilled;
            el.MeanSeverity = windEvent.Severity;


            eventLog.AddObject(el);
            eventLog.WriteToFile();

        }
Ejemplo n.º 2
0
        //---------------------------------------------------------------------

        public static Event Initiate(ActiveSite site,
                                     int windTimestep)
        {
            IEcoregion ecoregion = PlugIn.ModelCore.Ecoregion[site];
            IEventParameters eventParms = windEventParms[ecoregion.Index];
            double eventProbability = (windTimestep * PlugIn.ModelCore.CellArea) /
                                      (eventParms.RotationPeriod * eventParms.MeanSize);
            
            if (PlugIn.ModelCore.GenerateUniform() <= eventProbability) {
                Event windEvent = new Event(site, ComputeSizeHectares(eventParms));
                windEvent.Spread(PlugIn.ModelCore.CurrentTime);
                return windEvent;
            }
            else
                return null;
        }