示例#1
0
        //****************************************************************
        // PROCESS THE CONPLETEIVR EVENT
        //****************************************************************
        public void CompleteIRV()
        {
            //Happens when the call is accepted
            //Get type of call.
            if (activeEntity.callType == ECallType.stereo)
            {
                SalesRepClass freeRep = salesTeam.getFreeRep(ECallType.stereo);
                //Check to see if a sales rep is free.
                if (freeRep == null)
                {
                    //Was not a free person, add them to the approprate queue
                    mainQueue.addToQueue(activeEntity);
                }
                else
                {
                    //Was a free dude
                    freeRep.isFree = false;
                    activeEntity.personImTalkingTo = freeRep;

                    int interval      = Convert.ToInt16(diceRoller.DiceRoll() * 2);
                    int scheduledTime = currentTime + interval;
                    //New completeService Event
                    EventClass newEvent = new EventClass(activeEntity, EEventType.CompleteServiceCall, scheduledTime);
                    //Add new Event to the calendar
                    mainCalendar.addEvent(newEvent);
                }
            }
            else if (activeEntity.callType == ECallType.other)
            {
                SalesRepClass freeRep = salesTeam.getFreeRep(ECallType.other);
                //Check to see if a sales rep is free.
                if (freeRep == null)
                {
                    //Was not a free person
                    mainQueue.addToQueue(activeEntity);
                }
                else
                {
                    //Was a free dude
                    freeRep.isFree = false;                   //take that resource
                    activeEntity.personImTalkingTo = freeRep; //Assign it to the active entity

                    int interval      = Convert.ToInt16(diceRoller.DiceRoll() * 2);
                    int scheduledTime = currentTime + interval;
                    //New completeService Event
                    EventClass newEvent = new EventClass(activeEntity, EEventType.CompleteServiceCall, scheduledTime);
                    //Add new Event to the calendar
                    mainCalendar.addEvent(newEvent);
                }
            }
        }
示例#2
0
        //CONSTRUCTOR\\
        public SalesTeamClass()
        {
            //Allocate space for the lists
            stereoRep = new List <SalesRepClass>();
            otherRep  = new List <SalesRepClass>();

            //Statically create Sales Rep
            SalesRepClass salesRep = new SalesRepClass(ECallType.stereo);

            //Add to the Stereo List
            stereoRep.Add(salesRep);

            //Rinse and repeat
            SalesRepClass salesRep2 = new SalesRepClass(ECallType.other);
            SalesRepClass salesRep3 = new SalesRepClass(ECallType.other);

            //Add to the Stereo List
            otherRep.Add(salesRep2);
            //otherRep.Add(salesRep3);
        }
示例#3
0
        //****************************************************************
        // COMPLETE THE SERVICECALL EVENT
        //****************************************************************
        public void CompleteServiceCall()
        {
            //What happens when they comeplete the service call?

            /*
             * Calls complete
             * Free up that sales rep
             * grab from queue
             */

            //EntityClass newEntity = null;

            if (mainQueue.stereoWaiting.Count == 0) //If there isnt anyone waiting do what?
            {
                Console.WriteLine("Number of People on hold: " + mainQueue.stereoWaiting.Count);
            }
            else
            {
                if (activeEntity.callType == ECallType.stereo)    //Someone was in the queue
                {
                    activeEntity.personImTalkingTo.isFree = true; //Frees up the resource
                                                                  //Pretty sure he just dissapares from the system now. He no longer holds up any resources

                    int interval      = Convert.ToInt16(diceRoller.DiceRoll() * 2);
                    int scheduledTime = currentTime + interval;
                    //New completeService Event
                    EntityClass newEntity = mainQueue.getEntityWaiting(ECallType.stereo);
                    EventClass  newEvent  = new EventClass(newEntity, EEventType.CompleteServiceCall, scheduledTime);

                    SalesRepClass freeRep = salesTeam.getFreeRep(ECallType.stereo);
                    newEntity.personImTalkingTo = freeRep;//Assign it to the active entity
                    freeRep.isFree = false;

                    //Add new Event to the calendar
                    mainCalendar.addEvent(newEvent);
                }
            }

            if (mainQueue.otherWaiting.Count == 0)
            {
                Console.WriteLine("Number of people on Hold: " + mainQueue.otherWaiting.Count);
            }
            else
            {
                if (activeEntity.callType == ECallType.stereo)    //Someone was in the queue
                {
                    activeEntity.personImTalkingTo.isFree = true; //Frees up the resource
                                                                  //Pretty sure he just dissapares from the system now. He no longer holds up any resources

                    int interval      = Convert.ToInt16(diceRoller.DiceRoll() * 2);
                    int scheduledTime = currentTime + interval;
                    //New completeService Event
                    EntityClass newEntity = mainQueue.getEntityWaiting(ECallType.other);
                    EventClass  newEvent  = new EventClass(newEntity, EEventType.CompleteServiceCall, scheduledTime);

                    SalesRepClass freeRep = salesTeam.getFreeRep(ECallType.stereo);
                    newEntity.personImTalkingTo = freeRep;//Assign it to the active entity
                    freeRep.isFree = false;

                    //Add new Event to the calendar
                    mainCalendar.addEvent(newEvent);
                }

                int interval2      = Convert.ToInt16(diceRoller.DiceRoll() * 2);
                int scheduledTime2 = currentTime + interval2;
                //New completeService Event
                EventClass newEvent2 = new EventClass(activeEntity, EEventType.EndSim, scheduledTime2);
                mainCalendar.addEvent(newEvent2);
            }

            /*if (activeEntity.callType == ECallType.stereo) //Someone was in the queue
             * {
             *  activeEntity.personImTalkingTo.isFree = true; //Frees up the resource
             *                                                //Pretty sure he just dissapares from the system now. He no longer holds up any resources
             *
             *  int interval = Convert.ToInt16(diceRoller.DiceRoll() * 2);
             *  int scheduledTime = currentTime + interval;
             *  //New completeService Event
             *  EntityClass newEntity = mainQueue.getEntityWaiting(ECallType.stereo);
             *  EventClass newEvent = new EventClass(newEntity, EEventType.CompleteServiceCall, scheduledTime);
             *
             *  SalesRepClass freeRep = salesTeam.getFreeRep(ECallType.stereo);
             *  newEntity.personImTalkingTo = freeRep;//Assign it to the active entity
             *  freeRep.isFree = false;
             *
             *  //Add new Event to the calendar
             *  mainCalendar.addEvent(newEvent);
             * }
             * else
             * {
             *  activeEntity.personImTalkingTo.isFree = true; //Frees up the resource
             *
             *  int interval = Convert.ToInt16(diceRoller.DiceRoll() * 1);
             *  int scheduledTime = currentTime + interval;
             *  //New completeService Event
             *  EntityClass newEntity = mainQueue.getEntityWaiting(ECallType.other);
             *  EventClass newEvent = new EventClass(newEntity, EEventType.CompleteServiceCall, scheduledTime);
             *
             *  SalesRepClass freeRep = salesTeam.getFreeRep(ECallType.other);
             *  newEntity.personImTalkingTo = freeRep; //Assign it to the active entity
             *  freeRep.isFree = false; //take that resource
             *
             *  //Add new Event to the calendar
             *  mainCalendar.addEvent(newEvent);
             * }
             * //Thats it until the time reaches the EndSim eventTime.*/
        }