Пример #1
0
        public void Run()
        {
            while (eventQueue.isEmpty == false)
            {
                var e = eventQueue.Pop();
                if (e.time < this.clock)
                {
                    throw new Exception("No time travel plz");
                }
                this.clock = e.time;
                e.Handle();
                if (simulationParameters.debugType == DebugType.Always)
                {
                    DebugEvent.DebugNow(this, false, e);
                }
            }

            // force update awake time
            foreach (var r in relays)
            {
                r.UpdateAwakeTime();
            }

            if (simulationParameters.debugType != DebugType.Never)
            {
                debugWriter.Write("`");
                debugWriter.Close();
            }
        }
Пример #2
0
        public override void Handle()
        {
            // dump debugstats to file
            // clear event queue
            sim.eventQueue.Clear();

            if (sim.simulationParameters.debugType != DebugType.Never)
            {
                DebugEvent.DebugNow(sim, true, this);
            }

            return;
        }