Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

% Test and validation code lambda = 2 ; % Arrival rate: 2 calls per minute mu = 0 . 1 ; % Service rate:

% Test and validation code
lambda =2; % Arrival rate: 2 calls per minute
mu =0.1; % Service rate: 0.1 calls per minute per agent
c =4; % Placeholder, needs adjustment based on system requirements
% Placeholder, needs adjustment based on system requirements
Nwait = lambda /(mu - lambda);
% Calculate System Capacity (N)
N = c + Nwait;
% Call the MMCQ function with the given parameters
[Ws, Wq, c_util, p_drop, p_state]= MMCQ(lambda, mu, c, Nwait);
% Display the results
disp(['Ws: ', num2str(Ws)]);
disp(['Wq: ', num2str(Wq)]);
disp(['c_util: ', num2str(c_util)]);
disp(['p_drop: ', num2str(p_drop)]);
disp(['p_state: ', num2str(p_state)])
function [Ws, Wq, c_util, p_drop, p_state]= MMCQ(lambda, mu, c, Nwait)
% Calculate rho: the traffic intensity per server
rho = lambda / mu;
% Calculate p0, the probability of having zero customers in the system
p0=1/ sum((c * rho).^(0:c-1)/ factorial(0:c-1)+(c * rho)^c / factorial(c));
% Initialize p_state
p_state = zeros(1, Nwait +1);
p_state(1)= p0;
% Calculate p_state based on the number of customers relative to the number of servers (c)
for i =1:Nwait
ci = min(i, c);
if i <= c
p_state(i +1)= ci / c * p_state(i)* rho / factorial(i);
else
p_state(i +1)= c^ci / factorial(ci)* p_state(i)* rho^i / factorial(c);
end
end
p_state = p_state / sum(p_state);
% Calculate pN: the probability of dropping a customer (the system being full)
pN = p_state(Nwait +1);
% Calculate the rate of lost customers due to the system being full
lambda_loss = lambda * pN;
% Calculates the effective arrival rate, considering the lost customers
lambda_eff = lambda - lambda_loss;
% Calculate Lq: the average number of customers in the queue, calculated using the state probabilities
Lq = sum((0:Nwait).* p_state);
% Calculates Ls: the total average number of customers in the system, both in service and in the queue
Ls = Lq + lambda_eff / mu;
% Calculate c_bar (Average Busy Servers) and c_util (Utilization Factor)
c_bar = Ls - Lq;
c_util = c_bar / c;
p_drop = pN;
% Calculate Ws: the average time a customer spends in the system
Ws = Ls / lambda_eff;
% Calculate Wq: the average time a customer spends in the queue
Wq = Lq / lambda_eff;
end

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases On The Web Designing And Programming For Network Access

Authors: Patricia Ju

1st Edition

1558515100, 978-1558515109

More Books

Students also viewed these Databases questions

Question

In Exercise 40 what is the

Answered: 1 week ago

Question

design a simple performance appraisal system

Answered: 1 week ago