Ejemplo n.º 1
0
        public static bool DoStep()
        {
            // handle pending deferred-callbacks first
            while (!m_deferQueue.Empty && m_deferQueue.MinPrio <= Simulator.CurrentRound)
            {
                m_deferQueue.Dequeue() (); // dequeue and call the callback
            }
            if (CurrentRound == (ulong)Config.warmup_cyc)
            {
                Console.WriteLine("done warming");
                //Console.WriteLine("warmup_cyc {0}",Config.warmup_cyc);
                //throw new Exception("done warming");
                Simulator.stats.Reset();
                controller.resetStat();
                WarmingStats();
                Warming = false;
            }
            if (!Warming)
            {
                Simulator.stats.cycle.Add();
            }

            if (CurrentRound % 100000 == 0)
            {
                ProgressUpdate();
            }

            CurrentRound++;

            network.doStep();
            controller.doStep();

            return(!network.isFinished() && (Config.ignore_livelock || !network.isLivelocked()));
        }