Пример #1
0
        /// <summary>
        /// Perform the simulation.
        /// </summary>
        public void Run()
        {
            try
            {
                CurrentState = ReplicationState.WarmUp;

                // poke the queue to add first call event.
                _queue.Poke();

                uint currentTime = 0;

                // wait until warm up is done
                while (currentTime < _startup)
                {
                    currentTime = _queue.PerformNextEvent();
                }

                // set data gatherer to start collecting data
                CurrentState = ReplicationState.Running;
                ReplicationData.Record();

                // perform simulation
                do
                {
                    currentTime = _queue.PerformNextEvent();
                } while(currentTime < _replicationLength);

                CurrentState = ReplicationState.Finished;
            }
            catch (Exception e)
            {
                CurrentState = ReplicationState.Crashed;
                Console.WriteLine(e);
            }
        }