Class MMNdLogic
java.lang.Object
jmt.jmarkov.Queues.MM1Logic
jmt.jmarkov.Queues.MMNdLogic
- All Implemented Interfaces:
QueueLogic
- Author:
- arifc
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the maximum number of the jobs in the queue(only buffer)intReturns the number of the servers.doublegetStatusProbability(int status) Calculates the probability of each status.doubleCalculate the average jobs in the station with respect to lambda and sdoubleCalculates the average response time(R)voidsetMaxStates(int max) Sets the max states.doubleCalculates the average throughput(X)doubleCalculate the utilizaion of the server with respect to parameters lambda ,s and queue length and number of cpuMethods inherited from class MM1Logic
getArrivalTime, getLambda, getRunTime, getS, setLambda, setS
-
Constructor Details
-
MMNdLogic
public MMNdLogic(double lambda, double s, int aNumberOfServer, int amax) - Parameters:
lambda-s-
-
-
Method Details
-
getStatusProbability
Description copied from interface:QueueLogicCalculates the probability of each status.- Specified by:
getStatusProbabilityin interfaceQueueLogic- Overrides:
getStatusProbabilityin classMM1Logic- Parameters:
status- number of elements in the status- Returns:
- the probability of the status
- Throws:
NonErgodicException- if the operation cannot be completed
-
mediaJobs
Description copied from class:MM1LogicCalculate the average jobs in the station with respect to lambda and s- Specified by:
mediaJobsin interfaceQueueLogic- Overrides:
mediaJobsin classMM1Logic- Returns:
- number of average jobs in the station
- Throws:
NonErgodicException- queue is not ergodic (U > 1 o U < 0)
-
utilization
Calculate the utilizaion of the server with respect to parameters lambda ,s and queue length and number of cpu- Specified by:
utilizationin interfaceQueueLogic- Overrides:
utilizationin classMM1Logic- Returns:
- utilization
- Throws:
NonErgodicException- queue is not ergodic (U > 1 o U < 0)
-
throughput
Description copied from interface:QueueLogicCalculates the average throughput(X)- Specified by:
throughputin interfaceQueueLogic- Overrides:
throughputin classMM1Logic- Throws:
NonErgodicException
-
responseTime
Description copied from interface:QueueLogicCalculates the average response time(R)- Specified by:
responseTimein interfaceQueueLogic- Overrides:
responseTimein classMM1Logic- Throws:
NonErgodicException
-
getNumberServer
public int getNumberServer()Description copied from interface:QueueLogicReturns the number of the servers.- Specified by:
getNumberServerin interfaceQueueLogic- Overrides:
getNumberServerin classMM1Logic
-
getMaxStates
public int getMaxStates()Description copied from interface:QueueLogicReturns the maximum number of the jobs in the queue(only buffer)- Specified by:
getMaxStatesin interfaceQueueLogic- Overrides:
getMaxStatesin classMM1Logic- Returns:
- 0 if the buffer is ideal(infinite), a positive number, otherwise
-
setMaxStates
public void setMaxStates(int max) Description copied from class:MM1LogicSets the max states.- Overrides:
setMaxStatesin classMM1Logic- Parameters:
max-
-