public class ErlangAWeb extends Object
ErlangA
as an online program.
The results are formatted in JSON string.
Error messages are also returned as JSON string, see
java.lang.String)
.
This program can evaluate the performance of a waiting queue using Erlang A and also find the required minimum number of servers to satisfy a service level target.
Note that ErlangA
has multiple methods
to compute the service level.
The exact methods requires a finite queue capacity, whereas the quick approximation
methods, based on diffusion limits, assume an infinite queue size.
The choice of the service level function (whether the exact ErlangAWeb.SlFormula.SL1
and ErlangAWeb.SlFormula.SL2
,
or approximative ErlangAWeb.SlFormula.SLD
) will also affects the method selection for the
other performance measures: delay probability, abandonment ratio and average waiting time.
If the user chooses an exact SL formula, then the exact formulas for the performance measures will also be used.
Else, if the approximative SL formula is selected, then the other performance measures
will also be evaluated by approximative formulas.
Modifier and Type | Class and Description |
---|---|
static class |
ErlangAWeb.ErlangAResults
This class is used to hold the results of an evaluation of Erlang C.
|
static class |
ErlangAWeb.FindMinServers
|
static class |
ErlangAWeb.SlFormula
Enumerates the available service level (SL) formulas
evaluated with Erlang A.
|
Modifier and Type | Method and Description |
---|---|
static String |
getJson(LinkedList<ErlangAWeb.ErlangAResults> results,
TimeUnit waitUnit,
ErlangAWeb.SlFormula slf)
Returns the results in JSON format (String).
|
static String |
getJson(LinkedList<ErlangAWeb.ErlangAResults> results,
TimeUnit waitUnit,
ErlangAWeb.SlFormula slf,
int requiredServers)
Returns the results in JSON format (String) that is the same as
umontreal.iro.lecuyer.ccoptim.web.TimeUnit, umontreal.iro.lecuyer.ccoptim.web.ErlangAWeb.SlFormula)
except with an additional value that contains the required number of servers. |
static void |
main(String[] args)
Program to evaluate the performance measure of a queue using the Erlang A formula.
|
static String |
multiEvalErlangA(String arrivalRateP,
String arrivalRateUnitP,
String avgServiceTimeP,
String avgServiceTimeUnitP,
String avgPatienceTimeP,
String avgPatienceTimeUnitP,
String capacityP,
String numServerP,
String awtP,
String awtUnitP,
String avgWaitTimeUnitP,
String serverRangeP,
String slFormulaP)
Program to evaluate the performance measure of a queue using the Erlang A formula.
|
static String |
multiEvalMinServers(String arrivalRateP,
String arrivalRateUnitP,
String avgServiceTimeP,
String avgServiceTimeUnitP,
String avgPatienceTimeP,
String avgPatienceTimeUnitP,
String capacityP,
String awtP,
String awtUnitP,
String targetSLP,
String avgWaitTimeUnitP,
String serverRangeP,
String slFormulaP)
Program to find the minimum required number of servers in order to satisfy the service level target,
and then it evaluates the performance measure for this solution and its neighborhood.
|
public static String getJson(LinkedList<ErlangAWeb.ErlangAResults> results, TimeUnit waitUnit, ErlangAWeb.SlFormula slf)
result
has structure { "NumServers":n, "SL":sl, "Delay":delay, "Abandon":abandon, "AvgWaitTime":wait }.
The string slf
corresponds to the name of the service level enum ErlangAWeb.SlFormula
used.
Note all JSON values are returned in String format.
The returned string has the header Content-Type: application/json\n\n.
results
- the list of Erlang C evaluation resultswaitUnit
- the time unit of wait
slf
- the service level formula used to compute the service levelspublic static String getJson(LinkedList<ErlangAWeb.ErlangAResults> results, TimeUnit waitUnit, ErlangAWeb.SlFormula slf, int requiredServers)
umontreal.iro.lecuyer.ccoptim.web.TimeUnit, umontreal.iro.lecuyer.ccoptim.web.ErlangAWeb.SlFormula)
except with an additional value that contains the required number of servers.
The JSON structure is:
{"Results":[result, result, ...], "AvgWaitTimeUnit":waitUnit, "SlFormula":slf, "RequiredServers":requiredServers }
where result
has structure {"NumServers":n, "SL":sl, "Delay":delay, "Abandon":abandon, "AvgWaitTime":wait }.
The string slf
corresponds to the name of the service level enum ErlangAWeb.SlFormula
used.
Note all JSON values are returned in String format.
The returned string has the header Content-Type: application/json\n\n.
results
- the list of Erlang C evaluation resultswaitUnit
- the time unit of wait
slf
- the service level formula used to compute the service levelsrequiredServers
- the number of servers required to satisfy the service level targetpublic static String multiEvalErlangA(String arrivalRateP, String arrivalRateUnitP, String avgServiceTimeP, String avgServiceTimeUnitP, String avgPatienceTimeP, String avgPatienceTimeUnitP, String capacityP, String numServerP, String awtP, String awtUnitP, String avgWaitTimeUnitP, String serverRangeP, String slFormulaP)
The service level formula to use is given by the parameter slFormulaP
which
must corresponds to the name of one of ErlangAWeb.SlFormula
elements.
Use the parameter serverRangeP
to evaluate multiple numbers of servers around the
given numServerP
parameter.
The returned string is built by umontreal.iro.lecuyer.ccoptim.web.TimeUnit, umontreal.iro.lecuyer.ccoptim.web.ErlangAWeb.SlFormula)
.
arrivalRateP
- arrival ratearrivalRateUnitP
- time unit of the arrival rate (string: "hour", "minute" or "second")avgServiceTimeP
- average service time (this is the inverse of the service rate)avgServiceTimeUnitP
- time unit of the average service timeavgPatienceTimeP
- average patience time (this is the inverse of the patience rate)avgPatienceTimeUnitP
- time unit of the average patience timecapacityP
- queue capacity (must be integer, or set a negative integer value for unlimited queue capacity)numServerP
- number of servers (must be integer)awtP
- acceptable waiting timeawtUnitP
- time unit of the acceptable waiting timeavgWaitTimeUnitP
- time unit of the average waiting time result that will be returnedserverRangeP
- the range for multiple Erlang C evaluations. Let r be the range and n the number of
servers parameter, this program will evaluate Erlang C from n - r to n + r servers,
except if the number of servers is below 1.slFormulaP
- the formula to use to compute the service levelspublic static String multiEvalMinServers(String arrivalRateP, String arrivalRateUnitP, String avgServiceTimeP, String avgServiceTimeUnitP, String avgPatienceTimeP, String avgPatienceTimeUnitP, String capacityP, String awtP, String awtUnitP, String targetSLP, String avgWaitTimeUnitP, String serverRangeP, String slFormulaP)
java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
.
It evaluates the performance measures using Erlang A around the required number of servers.
To make the input more convenient for the user, the parameters can be given in different time unit among this set: "hour", "minute" or "second". The time unit must be given as a string.
The service level formula to use is given by the parameter slFormulaP
which
must corresponds to the name of one of ErlangAWeb.SlFormula
elements.
Note that if the exact service level formulas (SL1 and SL2) are chosen, but they cannot be
computed numerically for the given queue parameters, then this method will return an error message.
The user should then use the approximative formulas (for the SL, delay, average waiting time and abandonment ratio).
Use the parameter serverRangeP
to evaluate multiple numbers of servers around the
given numServerP
parameter.
The returned string is built by umontreal.iro.lecuyer.ccoptim.web.TimeUnit, umontreal.iro.lecuyer.ccoptim.web.ErlangAWeb.SlFormula, int)
.
arrivalRateP
- arrival ratearrivalRateUnitP
- time unit of the arrival rate (string: "hour", "minute" or "second")avgServiceTimeP
- average service time (this is the inverse of the service rate)avgServiceTimeUnitP
- time unit of the average service timeavgPatienceTimeP
- average patience time (this is the inverse of the patience rate)avgPatienceTimeUnitP
- time unit of the average patience timecapacityP
- queue capacity (must be integer, or set a negative integer value for unlimited queue capacity)awtP
- acceptable waiting timeawtUnitP
- time unit of the acceptable waiting timetargetSLP
- the service level target in percentage unit. This parameter must be between 0 and 100, inclusively.avgWaitTimeUnitP
- time unit of the average waiting time result that will be returnedserverRangeP
- the range for multiple Erlang C evaluations. Let r be the range and n the number of
servers parameter, this program will evaluate Erlang C from n - r to n + r servers,
except if the number of servers is below 1.slFormulaP
- the formula to use to compute the service levelspublic static void main(String[] args)
args
- see the method description