Example #1
0
        public void RunSim()
        {
            activeEvent  = mainCalendar.getTopEvent();
            activeEntity = activeEvent.currentEntity;

            while (activeEvent.currentEventType != EEventType.EndSim)
            {
                //update the system time.
                currentTime = activeEvent.schedualedTime;
                if (activeEvent.currentEventType == EEventType.CallArrive)
                {
                    //Process the call.
                    ProcessCallArrive();
                }
                if (activeEvent.currentEventType == EEventType.CompleteIVR)
                {
                    //Process the switch.
                    CompleteIRV();
                }
                if (activeEvent.currentEventType == EEventType.CompleteServiceCall)
                {
                    //Process the completion of the service call.
                    CompleteServiceCall();
                }
                if (activeEvent.currentEventType == EEventType.EndSim)
                {
                    //End the simulation.
                    EndSim();
                }

                activeEvent  = mainCalendar.getTopEvent();
                activeEntity = activeEvent.currentEntity;

                mainCalendar.displayCalendar(box);
                box.Items.Add("-----------------------------");
                onlyLable.Text  = "" + hangupCount + " people hung up.";
                queueCount.Text = "" + mainQueue.totalLengthOfQueue();

                //FOR DEBUGGING
                box2.Items.Add("-----------------------------");
                box2.Items.Add("Active Entity: " + activeEvent.currentEntity.entityID);
                box2.Items.Add("Active Event: " + activeEvent.currentEventType);
                box2.Items.Add("Time: " + activeEvent.schedualedTime);
                box2.Items.Add("-----------------------------");

                mainForm.Refresh();
            }
        }