Question: //main.c #include #include #include #include #include cs2123p4.h int main(int argc, char *argv[]) { int iTimeLimit = MAX_CLOCK_TIME; Simulation simulation = newSimulation(); //process command line switches

 //main.c #include #include #include #include #include "cs2123p4.h" int main(int argc, char

//main.c #include #include #include #include #include "cs2123p4.h" int main(int argc, char *argv[]) { int iTimeLimit = MAX_CLOCK_TIME; Simulation simulation = newSimulation(); //process command line switches processCommandSwitches(argc, argv, simulation); //call populateSim to populate our sim from standard input generateArrival(simulation); //call run simulation runSimulation(simulation, iTimeLimit); }

void runSimulation(Simulation simulation, int iTimeLimit) { Event event; //declare our queues Queue queueW = newQueue("queueW"); Queue queueM = newQueue("queueM"); //declare and allocate our two servers Server serverW = newServer("serverW"); Server serverM = newServer("serverM"); //read in all of our arrival events from the input file //generateArrival(simulation); //Format header differently depending if we're in verbose mode or not if (simulation->bVerbose == TRUE) printf("Time\t Widget\t Event "); else printf("Time\t \t Event"); //iterate while there are events to process in the linked-list while (removeLL(simulation->eventList, &event)) { //advance clock to the next arrival time with each iteration simulation->iClock = event.iTime; switch(event.iEventType) { case EVT_ARRIVAL: if (simulation->bVerbose == TRUE) printf("%d\t %ld\t Arrived ", simulation->iClock\ , event.widget.lWidgetNr); if (event.widget.iWhichServer == 1) { queueUp(simulation, queueM, &event.widget); seize(simulation, queueM, serverM); } else { queueUp(simulation, queueW, &event.widget); seize(simulation, queueW, serverW); } break; case EVT_SERVERM_COMPLETE: release(simulation, queueM, serverM, &event.widget); leaveSystem(simulation, &event.widget); break; case EVT_SERVERW_COMPLETE: release(simulation, queueW, serverW, &event.widget); leaveSystem(simulation, &event.widget); break; default: ErrExit(ERR_ALGORITHM, "Unknown event type: %d ", event.iEventType); } } //print simulation statistics printf(" %d\t\t Simulation complete for alternative A. ", simulation->iClock); printf("Average Queue Time for Server M: %.1f "\ , (double) queueM->lQueueWaitSum / queueM->lQueueWidgetTotalCount); printf("Average Queue Time for Server W: %.1f "\ , (double) queueW->lQueueWaitSum / queueW->lQueueWidgetTotalCount); printf("Average time in System: %.1f "\ , (double) simulation->lSystemTimeSum / simulation->lWidgetCount); //The simulation is complete. Free up our memory free(queueW); free(queueM); free(serverW); free(serverM); free(simulation->eventList); free(simulation); }

void seize(Simulation simulation, Queue queue, Server server) { //Only execute the body of the function (seize the server) //if the server is not marked busy if (server->bBusy == FALSE) { QElement qElement; Event eventServerComplete; int iWaited; //mark the server as busy, and remove a widget from the queue server->bBusy = TRUE; removeQ(queue, &qElement); //assign the widget to the server server->widget = qElement.widget; //update statistics iWaited = simulation->iClock - qElement.iEnterQTime; queue->lQueueWaitSum += iWaited;

if (simulation->bVerbose == TRUE) printf("%d\t %ld\t Seized server %s ", simulation->iClock\ , qElement.widget.lWidgetNr, server->szServerName); //set the values of our completion event eventServerComplete.iTime = simulation->iClock + server->widget.iStep1tu\ + server->widget.iStep2tu; eventServerComplete.widget.lWidgetNr = server->widget.lWidgetNr; eventServerComplete.widget.iWhichServer = server->widget.iWhichServer; eventServerComplete.widget.iArrivalTime = server->widget.iArrivalTime; if (eventServerComplete.widget.iWhichServer == 1) { eventServerComplete.iEventType = EVT_SERVERM_COMPLETE; if (simulation->bVerbose == TRUE) printf("%d\t %ld\t Leave Queue M, waited %d "\ , simulation->iClock, qElement.widget.lWidgetNr, iWaited); } else { eventServerComplete.iEventType = EVT_SERVERW_COMPLETE; if (simulation->bVerbose == TRUE) printf("%d\t %ld\t Leave Queue W, waited %d "\ , simulation->iClock, qElement.widget.lWidgetNr, iWaited); }

//finally, store the event in our linked-list insertOrderedLL(simulation->eventList, eventServerComplete); } } void generateArrival(Simulation simulation) { Event eventArrival; char szInputBuffer[MAX_LINE_SIZE]; int iArrivalDelta; FILE *inputFile; inputFile = fopen(INPUT_FILE, "r"); //set event types eventArrival.iEventType = EVT_ARRIVAL; //iterate with each delimited line from standard input //create an arrival event in our linked list with each iteration while (fgets(szInputBuffer, 100, inputFile) != NULL) { if (szInputBuffer[0] == ' ') break; //scan data into eventArrival and iArrivalDelta sscanf(szInputBuffer, "%ld %d %d %d %d", &eventArrival.widget.lWidgetNr\ , &eventArrival.widget.iStep1tu, &eventArrival.widget.iStep2tu\ , &iArrivalDelta, &eventArrival.widget.iWhichServer); //populate the rest of eventArrival eventArrival.iTime = simulation->iClock; eventArrival.widget.iArrivalTime = simulation->iClock; //insert the arrival into our linked list insertOrderedLL(simulation->eventList, eventArrival); //advance the clock so that the next arrival time is correct simulation->iClock = simulation->iClock + iArrivalDelta; } }

void queueUp(Simulation simulation, Queue queue, Widget *pWidget) { QElement qElement; qElement.widget = *pWidget; qElement.iEnterQTime = simulation->iClock; insertQ(queue, qElement); queue->lQueueWidgetTotalCount++; if (simulation->bVerbose == TRUE) printf("%d\t %ld\t Enter %s ", simulation->iClock, qElement.widget.lWidgetNr\ , queue->szQName); }

void release(Simulation simulation, Queue queue, Server server, Widget *pWidget) { server->bBusy = FALSE; if (simulation->bVerbose == TRUE) printf("%d\t %ld\t Released server W ", simulation->iClock, pWidget->lWidgetNr); //don't seize if the queue is empty if (queue->pHead != NULL) seize(simulation, queue, server); }

void leaveSystem(Simulation simulation, Widget *pWidget) { simulation->lWidgetCount++; //total widget time is when is when it arrived subtracted from the //the current clock time int iSpentInSystem = simulation->iClock - pWidget->iArrivalTime; simulation->lSystemTimeSum += iSpentInSystem; if (simulation->bVerbose == TRUE) printf("%d\t %ld\t Exit System, in system %d ", simulation->iClock\ , pWidget->lWidgetNr, iSpentInSystem); }

========================================================================== // cs2123p4_DS.c

#include #include #include #include #include "cs2123p4.h" //begin queue functions int removeQ(Queue queue, QElement *pFromQElement) { NodeQ *p; // check for empty if (queue->pHead == NULL) return FALSE; p = queue->pHead; *pFromQElement = p->element; queue->pHead = p->pNext; // Removing the node could make the list empty. // See if we need to update pFoot, due to empty list if (queue->pHead == NULL) queue->pFoot = NULL; free(p); return TRUE; }

void insertQ(Queue queue, QElement element) { NodeQ *pNew; pNew = allocNodeQ(queue, element); // check for empty if (queue->pFoot == NULL) { queue->pFoot = pNew; queue->pHead = pNew; } else { // insert after foot queue->pFoot->pNext = pNew; queue->pFoot = pNew; } }

NodeQ *allocNodeQ(Queue q, QElement value) { NodeQ *pNew; pNew = (NodeQ *)malloc(sizeof(NodeQ)); if (pNew == NULL) ErrExit(ERR_ALGORITHM, "No available memory for queue"); pNew->element = value; pNew->pNext = NULL; return pNew; }

Queue newQueue(char szQueueNm[]) { Queue q = (Queue)malloc(sizeof(QueueImp)); // Mark the list as empty q->pHead = NULL; // empty list q->pFoot = NULL; // empty list strcpy(q->szQName, szQueueNm); q->lQueueWaitSum = 0; q->lQueueWidgetTotalCount = 0; return q; } //end queue functions //begin linked list functions int removeLL(LinkedList list, Event *pValue) { NodeLL *p;

if (list->pHead == NULL) return FALSE;

*pValue = list->pHead->event; p = list->pHead; list->pHead = list->pHead->pNext; free(p); return TRUE; } NodeLL *insertOrderedLL(LinkedList list, Event value) { NodeLL *pNew, *pPrecedes;

// call searchLL to properly set our pPrecedes searchLL(list, value.iTime, &pPrecedes);

// Allocate a node and insert. pNew = allocateNodeLL(list, value);

// Check for inserting at the beginning of the list // this will also handle when the list is empty if (pPrecedes == NULL) { pNew->pNext = list->pHead; list->pHead = pNew; } else { pNew->pNext = pPrecedes->pNext; pPrecedes->pNext = pNew; } return pNew; } NodeLL *searchLL(LinkedList list, int match, NodeLL **ppPrecedes) { NodeLL *p;

// used when the list is empty or we need to insert at the beginning *ppPrecedes = NULL;

// Traverse through the list looking for where the key belongs or // the end of the list. for (p = list->pHead; p != NULL; p = p->pNext) { if (match == p->event.iTime) return p; else if (match event.iTime) return NULL; *ppPrecedes = p; }

// Not found, return NULL return NULL; } LinkedList newLinkedList() { LinkedList list = (LinkedList) malloc(sizeof(LinkedListImp)); //Mark the list as empty list->pHead = NULL; // empty list return list; } NodeLL *allocateNodeLL(LinkedList list, Event value) { NodeLL *pNew;

pNew = (NodeLL *)malloc(sizeof(NodeLL));

if (pNew == NULL) ErrExit(ERR_ALGORITHM, "No available memory for linked list");

pNew->event = value; pNew->pNext = NULL; return pNew; } //end queue functions ======================================================================== //cs2123p4_helper.c #include #include #include #include #include "cs2123p4.h" Simulation newSimulation() { Simulation s = (Simulation) malloc(sizeof(SimulationImp)); s->iClock = 0; s->lWidgetCount = 0; s->lSystemTimeSum = 0; s->eventList = newLinkedList(); return s; } //create a new server, and mark it as not busy Server newServer(char szServerNm[]) { Server s = (Server)malloc(sizeof(ServerImp)); strcpy(s->szServerName,szServerNm); s->bBusy = FALSE; return s; }

void processCommandSwitches(int argc, char *argv[], Simulation simulation) { int i; // Examine each of the command arguments other than the name of the program. for (i = 1; i bVerbose = TRUE; break; case '?': exitUsage(USAGE_ONLY, "", ""); break; default: exitUsage(i, ERR_EXPECTED_SWITCH, argv[i]); } } }

void ErrExit(int iexitRC, char szFmt[], ... ) { va_list args; // This is the standard C variable argument list type va_start(args, szFmt); // This tells the compiler where the variable arguments // begins. They begin after szFmt. printf("ERROR: "); vprintf(szFmt, args); // vprintf receives a printf format string and a // va_list argument va_end(args); // let the C environment know we are finished with the // va_list argument printf(" \tEncountered in file %s ", __FILE__); // this 2nd arg is filled in by // the pre-compiler exit(iexitRC); } void exitUsage(int iArg, char *pszMessage, char *pszDiagnosticInfo) { if (iArg == USAGE_ONLY) { printf("command line arguents: -v \t Enable verbose mode. "); exit(USAGE_ONLY); } if (iArg >= 0) { fprintf(stderr, "Error: bad argument #%d. %s %s ", iArg, pszMessage, pszDiagnosticInfo); printf("Valid arguments: -v, -? "); } if (iArg >= 0) exit(ERR_COMMAND_LINE_SYNTAX);

} ====================================================================

#define INPUT_FILE "p4Input.txt" #define MAX_TOKEN 50 // Maximum number of actual characters for a token #define MAX_LINE_SIZE 100 // Maximum number of character per input line #define MAX_ARRIVAL_TIME 600 #define MAX_CLOCK_TIME 1000 // Maximum allowed simulation run time // Error constants (program exit values) #define ERR_COMMAND_LINE 900 // invalid command line argument #define ERR_ALGORITHM 903 // Error in algorithm - almost anything else #define ERR_BAD_INPUT 503 // Bad input // Error Messages #define ERR_MISSING_SWITCH "missing switch" #define ERR_EXPECTED_SWITCH "expected switch, found" #define ERR_MISSING_ARGUMENT "missing argument for" // Event Constants #define EVT_ARRIVAL 1 // when a widget arrives #define EVT_SERVERM_COMPLETE 2 // when a widget completes with server M #define EVT_SERVERW_COMPLETE 3 // when a widget completes with server W #define EVT_SERVERX_COMPLETE 4 // when a widget completes with server X #define EVT_SERVERY_COMPLETE 5 // when a widget completes with server Y // exitUsage control #define USAGE_ONLY 0 // user only requested usage information #define USAGE_ERR -1 // usage error, show message and usage information #define ERR_COMMAND_LINE_SYNTAX -1 // invalid command line syntax // boolean constants #define FALSE 0 #define TRUE 1 /* EOF */ #define REACHED_EOF 1 /*** typedef ***/ // Widget typedef typedef struct { long lWidgetNr; // Identifies a widget int iStep1tu; // Step 1 time units int iStep2tu; // Step 2 time units int iArrivalTime; // Arrival time in tu int iWhichServer; // For the alternatives, this specifies which server } Widget; // Event typedef typedef struct { int iEventType; // The type of event as an integer: // EVT_ARRIVAL - arrival event // EVT_SERVERM_COMPLETE - servicing by server M is complete // EVT_SERVERW_COMPLETE - servicing by server W is complete // EVT_SERVERX_COMPLETE - servicing by server X is complete // EVT_SERVERY_COMPLETE - servicing by server Y is complete int iTime; // The time the event will occur Widget widget; // The widget involved in the event. } Event; // typedefs for the Linked Lists used for the event list typedef struct NodeLL { Event event; struct NodeLL *pNext; } NodeLL; typedef struct { NodeLL *pHead; } LinkedListImp; typedef LinkedListImp *LinkedList; // typedefs for the queues typedef struct { Widget widget; int iEnterQTime; // time widget was inserted in queue } QElement; typedef struct NodeQ { QElement element; struct NodeQ *pNext; } NodeQ; typedef struct { NodeQ *pHead; NodeQ *pFoot; long lQueueWaitSum; // Sum of wait times for the queue long lQueueWidgetTotalCount; // Total count of widgets that entered queue char szQName[12]; } QueueImp; typedef QueueImp *Queue; // typedefs for server typedef struct { char szServerName[12]; int bBusy; // TRUE - server is busy, FALSE - server is free Widget widget; // Widget the server is currently working } ServerImp; typedef ServerImp *Server; // typedefs for the Simulation typedef struct { int iClock; // clock time int bVerbose; // When TRUE, this causes printing of event information long lSystemTimeSum; // Sum of times widgets are in the system long lWidgetCount; // The number of widgets processed char cRunType; // A - Alternative A, B - Alternative B, C - Current LinkedList eventList; } SimulationImp; typedef SimulationImp *Simulation; /********** prototypes ***********/ // linked list functions - you must provide the code for these (see course notes) int removeLL(LinkedList list, Event *pValue); NodeLL *insertOrderedLL(LinkedList list, Event value); NodeLL *searchLL(LinkedList list, int match, NodeLL **ppPrecedes); LinkedList newLinkedList(); NodeLL *allocateNodeLL(LinkedList list, Event value); // queue functions int removeQ(Queue queue, QElement *pFromQElement); void insertQ(Queue queue, QElement element); NodeQ *allocNodeQ(Queue queue, QElement value); Queue newQueue(char szQueueNm[]); // simulation functions void runSimulation(Simulation simulation, int iTimeLimit); void generateArrival(Simulation simulation); // simulation helper functions void queueUp(Simulation simulation, Queue queue, Widget *pWidget); void seize(Simulation simulation, Queue queue, Server server); void release(Simulation simulation, Queue queue, Server server, Widget *pWidget); void leaveSystem(Simulation simulation, Widget *pWidget); Server newServer(char szServerNm[]); Simulation newSimulation(); // functions in most programs, but require modifications void exitUsage(int iArg, char *pszMessage, char *pszDiagnosticInfo); // Utility routines provided by Larry (copy from program #2) void ErrExit(int iexitRC, char szFmt[], ...); //char * getToken(char *pszInputTxt, char szToken[], int iTokenSize); void processCommandSwitches(int argc, char *argv[], Simulation simulation);

/********************************************************************** cs2123p4.h Purpose: Defines constants: max constants error constants event type constants boolean constants Defines typedef for Widget Event (instead of Element) For Linked List NodeLL LinkedListImp LinkedList For Queues QElement NodeQ QueueImp Queue For the Servers ServerImp Server For the Simulation SimulationImp Simulation Protypes Functions provided by student Other functions provided by Larry previously (program 2) Utility functions provided by Larry previously (program 2) Notes:

**********************************************************************/

/*** constants ***/ // Maximum constants

#define MAX_TOKEN 50 // Maximum number of actual characters for a token #define MAX_LINE_SIZE 100 // Maximum number of character per input line #define MAX_ARRIVAL_TIME 600

// Error constants (program exit values) #define ERR_COMMAND_LINE 900 // invalid command line argument #define ERR_ALGORITHM 903 // Error in algorithm - almost anything else #define ERR_BAD_INPUT 503 // Bad input

// Error Messages #define ERR_MISSING_SWITCH "missing switch" #define ERR_EXPECTED_SWITCH "expected switch, found" #define ERR_MISSING_ARGUMENT "missing argument for"

// Event Constants #define EVT_ARRIVAL 1 // when a widget arrives #define EVT_SERVERW_COMPLETE 2 // when a widget completes with server W #define EVT_SERVERX_COMPLETE 3 // when a widget completes with server X #define EVT_SERVERY_COMPLETE 4 // when a widget completes with server Y // exitUsage control #define USAGE_ONLY 0 // user only requested usage information #define USAGE_ERR -1 // usage error, show message and usage information

// boolean constants #define FALSE 0 #define TRUE 1

/* EOF */ #define REACHED_EOF 1

/*** typedef ***/

// Widget typedef typedef struct { long lWidgetNr; // Identifies a widget int iStep1tu; // Step 1 time units int iStep2tu; // Step 2 time units int iArrivalTime; // Arrival time in tu int iWhichServer; // For the alternatives, this specifies which server } Widget;

// Event typedef typedef struct { int iEventType; // The type of event as an integer: // EVT_ARRIVAL - arrival event // EVT_SERVERW_COMPLETE - servicing by server W is complete // EVT_SERVERX_COMPLETE - servicing by server X is complete // EVT_SERVERY_COMPLETE - servicing by server Y is complete int iTime; // The time the event will occur Widget widget; // The widget involved in the event. } Event;

// typedefs for the Linked Lists used for the event list typedef struct NodeLL { Event event; struct NodeLL *pNext; } NodeLL;

typedef struct { NodeLL *pHead; } LinkedListImp;

typedef LinkedListImp *LinkedList;

// typedefs for the queues

typedef struct { Widget widget; int iEnterQTime; // time widget was inserted in queue } QElement;

typedef struct NodeQ { QElement element; struct NodeQ *pNext; } NodeQ;

typedef struct { NodeQ *pHead; NodeQ *pFoot; long lQueueWaitSum; // Sum of wait times for the queue long lQueueWidgetTotalCount; // Total count of widgets that entered queue char szQName[12]; } QueueImp;

typedef QueueImp *Queue;

// typedefs for server typedef struct { char szServerName[12]; int bBusy; // TRUE - server is busy, FALSE - server is free Widget widget; // Widget the server is currently working long lWidgetCount; // Number of widgets in server long lLastServerBeginTime; // long lServerTimeSum; } ServerImp; typedef ServerImp *Server;

// typedefs for the Simulation typedef struct { int iClock; // clock time int bVerbose; // When TRUE, this causes printing of event information long lSystemTimeSum; // Sum of times widgets are in the system long lWidgetCount; // The number of widgets processed char cRunType; // A - Alternative A, B - Alternative B, C - Current LinkedList eventList; } SimulationImp; typedef SimulationImp *Simulation;

/********** prototypes ***********/

// linked list functions - you must provide the code for these (see course notes) int removeLL(LinkedList list, Event *pValue); NodeLL *insertOrderedLL(LinkedList list, Event value); NodeLL *searchLL(LinkedList list, int match, NodeLL **ppPrecedes); LinkedList newLinkedList(); NodeLL *allocateNodeLL(LinkedList list, Event value); LinkedList newList();

// queue functions int removeQ(Queue queue, QElement *pFromQElement); void insertQ(Queue queue, QElement element); NodeQ *allocNodeQ(Queue queue, QElement value); Queue newQueue(char szQueueNm[]);

// simulation functions - you must provide code for this void runSimulation(Simulation simulation); Simulation newSim(LinkedList list); //print function void printQ(Simulation sim, NodeQ *q, char nodeName[]);

// functions in most programs, but require modifications void exitUsage(int iArg, char *pszMessage, char *pszDiagnosticInfo);

void freeSim(Simulation sim); // Utility routines provided by Larry (copy from program #2) void ErrExit(int iexitRC, char szFmt[], ...); char * getToken(char *pszInputTxt, char szToken[], int iTokenSize);

/*******************input file

1 10 18 13 1 2 22 26 12 1 3 39 30 14 2 4 30 16 7 2 5 12 24 18 1 6 32 19 17 2 7 9 23 12 1 8 31 18 8 1 9 16 19 0 1 10 40 17 4 1 11 16 28 11 2 12 38 12 0 2 13 34 11 11 1 14 15 28 3 2 15 16 28 19 1 16 9 21 14 1 17 5 23 10 1 18 9 20 20 2 19 19 19 10 1 20 35 10 12 1 21 14 12 18 1 22 5 27 10 1 23 40 26 18 2 24 7 14 14 1 25 31 13 18 2 26 14 24 19 1 27 29 28 12 1 28 34 10 2 2 29 37 14 12 2 30 34 22 15 1 31 15 28 5 1 32 40 18 9 1 33 40 29 8 1 34 26 20 1 1 35 8 24 10 2 36 18 12 12 2 37 10 15 16 1 38 34 13 17 1 39 7 20 12 1 40 5 30 9 2 41 27 27 9 2 42 25 25 1 2 43 7 21 1 1 44 19 26 18 2 45 29 25 12 1 46 6 19 11 2 47 35 18 12 1 48 24 15 11 2 49 29 23 20 2 50 23 12 7 1

Pgm #4 Machine improvement Proposals 50 points Server Wis a bottleneck and does many things. Its step 1 takes an average of 10 tu and its step 2 takes erage of 20 tu dget at a step 2, no widg time. ls on an only pl an be serviced every 10 tu. Running the erver for widgets, ou on step i. Average arrival rate average watt time has been over 500 Alternative A. Add a new server [server Ml simila o server W to do the same work as server W. Serve M d ep 1 p 2 Eet al y p Widgets will either queue up for server M (and be processed by server M) or queue up for server W and be pr ocessed to purchase Server M wi be $2M $200K m server W Cost ainten ance per are doubling our server capacity, the execu tives think th cut both the year. Sin average wait time and average time In the system in half, he downtime to expected to be the same for both alternatives so it isn a factor o produce Statist e Average time in system (from arrival to completion at step 2) verage queue time for each serve Input-p4input txt Widget Nr istepltu iStep2tu iArrivalDelta iWhich Server Midge entifies a widget going through the system step 1 for this widget istep1tu or step 2 for this widget iStep2tu valDelta delta time units before next widget arrives rWhichServer-determines which server to use when given an option or alternative For alternative B (extra credit): 1 server X, 2 erver Y cument, whichServer isn't u Paints Part A-50 points Provide a simulati of alternative A. e nclude a switch (-v) which has no corresponding argument, If-vis specified, this is verbose mode. This causes your to print all clock times and events as they happen: Arrival, Enter Queue M, Leave Queue Mr Seize Server M, Release Server M, Enter Queue W, Leave Queue W, Seize Server W, Release Server w, Exit system. Fol some of those events, you should print additional information (time in queue, time i system See the sample output below When mulating for alternative Aw make certain you add iStep1tu and istep2tu for the for eac rocessing show the statistics sp above. Run the simulation for 50 widgets. Allow all of the widgets to complete both steps and exit the system Sample output: Simulation Alternative A Time Widget Event 1 Arrived a 1 Er Queue M nter a 1 Leave Queue M, waited 1 Seized Server M 13 ved 13 2 Enter e N 13 2 Leave Queue W, waited 0 13 2 Seized Server W 3 Arrived 3 Enter e MA 36 1 Released Server M 36 3 Leave e M. ted 8 36 3 Seized Server M 36 1 Exit System, in system 36 42 4 Arrived 42 ue W nter 49 5 Arrived 49 5 Enter ue M 56 2 R Server elease W 56 4 Leave Queue W, waited 14 56 Seized Server W 56 2 Exit Syste in syst em 43 67 6 A ved 67 6 Enter e N 77 3 Released Server M 924 Simulation Complete for Alternative A Average Q ue Time for Server M Average Queue Time for Server W Average Time in System

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!