Пример #1
0
        private void Preprocess()
        {
            if (m_isFinished)
            {
                Log("\n *** Simulation started *** \n");

                // Initialize starting events
                TenantGenerator generator;
                TenantQueue     queue;
                foreach (int key in GeneratorsController.Floors)
                {
                    generator = GeneratorsController.Get(key);
                    queue     = QueuesController.Get(key);

                    CreateEvent_NewTenant(generator, queue);
                }

                // Force update statistics
                GeneratorsController.UpdateStatistics();
                QueuesController.UpdateStatistics();
                ElevatorsController.UpdateStatistics();

                m_isFinished = false;
            }
            else
            {
                Log("\n *** Simulation continued *** \n");
            }
        }
Пример #2
0
        public void CreateEvent_Pickup(Elevator elevator)
        {
            // Get associated queue
            TenantQueue queue = QueuesController.Get(elevator.CurrentFloor);

            if (queue.IsHallcall(elevator.Direction) &&
                elevator.FreePlace > 0)
            {
                m_scheduler.Add(new PickupEvent(Time, this, queue, elevator));
            }
        }