Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need a MATLAB Expert help to get my MATLAB Code work to validate the MMCQ Multiserver finite call center queuing system tests all passed.
I need a MATLAB Expert help to get my MATLAB Code work to validate the MMCQ Multiserver finite call center queuing system tests all passed. I posted the project many times to get it right but no luck with chegg expert so far. Here is the code below: The issues to be fixed are : All validation tests should pass correct the p calcualtion, pN and N values and recomended the optimal number of servers and lambda for the all validation tests to pass: Run this test case to check your code
Test and validation code
lambda ; Arrival rate: calls per minute
mu ; Service rate: calls per minute per agent
Assuming an initial number of agents for the calculation
c ; Placeholder, needs adjustment based on system requirements
Nwait Nwait Maximum number of customers waiting in the queue. Placeholder, needs adjustment based on system requirements
Calculate Nwait based on the arrival and service rate
Nwait is maximum queue length.
Nwait lambda mu lambda;
Calculate System CapacityN c Queue Length
N c Nwait;
Call the MMCQ function with the given parameters
Ws Wq cutil, pdrop, pstate MMCQlambda mu c Nwait;
Run this test case to check your code
Ws Wq cutil, pdrop, pstate MMCQ;
Define a relative error function
relerror @xy absx yy;
Validate the results and print "PASS" or "FAIL" for each metric
if relerrorWs
fprintfWs f PASS
Ws;
else
fprintfWs f FAIL
Ws;
end
if relerrorWq
fprintfWqf PASS
Wq;
else
fprintfWq f FAIL
Wq;
end
if relerrorcutil,
fprintfcutil f PASS
cutil;
else
fprintfcutil f FAIL
cutil;
end
if relerrorpdrop,
fprintfpdrop f PASS
pdrop;
else
fprintfpdrop f FAIL
pdrop;
end
fprintfpstate s
numstrpstate;
Extra Tests
pstate should have Nwait probabilities
if relerrorsumpstate
dispThe probabilities sum to Test PASSED';
else
dispThe probabilities do not sum to Test FAILED.;
end
Extra Tests
disppstate: numstrpstate;
if abssumpstatee
dispThe probabilities sum to Test PASSED.;
else
dispThe probabilities do not sum to Test FAILED.;
end
function Ws Wq cutil, pdrop, pstate MMCQlambda mu c Nwait
function Ws Wq cutil, pdrop, pstate MMCQlambda mu c Nwait
Calculate rho: the traffic intensity per server, which is the ratio of the arrival rate to the combined service rate of all servers.
rho lambda mu; updated for the MMCQ Finite Queuing System
Calculate p the probability of having zero customers in the system.
Calculate the probability of zero customers in the system
psumcrho:c factorial:ccrhoc factorialc rho;
Calculate the average number of customers in the queue
Nwait rhoc c rho Pfactorialc rho;
pstate zeros Nwait ;
Calculate the total number of possible customers in the system.
N clambdamuN factorialc lambdacmu p;
Calculate System CapacityN c Queue Length
N c Nwait;
dispN;
fprintfThe total number of possible customers in the system, N s
N;
pstate zeros N ;
pstate p;
Calculate the pstate based on the number of customers relative to the number of servers c:
For states c to Nwait Customers Being Served or Waiting:the system includes customers waiting in the queue. for i :Nwait
for i :N
ci mini c;
if i c
pstatei ci c pstatei rho factoriali;
else
pstatei cci factorialci pstatei rhoi factorialc;
end
end
pstate pstate sumpstate;
Calculate pN: the probability of dropping a customer the system being full
pN pstateN;
pN pstateNwait ;
pN clambdamuN factorialc lambdacmu p;
Calculate the rate of lost customers due to the system being full.
lambdaloss lambda pN;
Calculates the effective arrival rate, considering the lost customers.
lambdaeff lambda lambdaloss;
Calculate Lq: the average number of customers in the queue, calculated using the state probabilities.
Lq sum:N pstate;
Calculates Ls: the total average number of customers in the system, both in service and in the queue.
Ls Lq lambdaeff mu;
Calculate cbar Average Busy Servers and cutil Utilization Factor:
cbar Ls Lq;
cutil cbar c;
pdrop pN;
Calculate Ws:the average time a customer spends in the system.
Ws Ls lambdaeff;
Calcualte Wq: the average time a customer spends in the queue.
Wq Lq lambdaeff;
end All the validation tests failed. Ws FAIL
Wq FAIL
cutil FAIL
pdrop I am getting the following output
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started