public class ErlangBWeb extends Object
ErlangB
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 B and also find the minimum required number of servers that satisfies a maximum blocking probability threshold.
Modifier and Type | Class and Description |
---|---|
static class |
ErlangBWeb.ErlangBResults
This class is used to hold the results of an evaluation of Erlang B.
|
static class |
ErlangBWeb.FindMinServers
This subclass is used only to execute the method
java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String) . |
Modifier and Type | Method and Description |
---|---|
static String |
getJson(LinkedList<ErlangBWeb.ErlangBResults> results)
Returns the results in JSON format (String).
|
static String |
getJson(LinkedList<ErlangBWeb.ErlangBResults> results,
int requiredServers)
Returns the results in JSON format (String) that is the same as
getJson(java.util.LinkedList)
except with an additional value that contains the required number of servers. |
static void |
main(String[] args)
Program to evaluate the blocking probability using the Erlang B formula.
|
static String |
multiEvalErlangB(String arrivalRateP,
String arrivalRateUnitP,
String avgServiceTimeP,
String avgServiceTimeUnitP,
String numServerP,
String serverRangeP)
Program to evaluate the performance measure of a queue using the Erlang B formula.
|
static String |
multiEvalMinServers(String arrivalRateP,
String arrivalRateUnitP,
String avgServiceTimeP,
String avgServiceTimeUnitP,
String targetBlockP,
String serverRangeP)
Program to find the minimum required number of servers that satisfies the maximum blocking probability threshold,
and then it evaluates the blocking probabilities of this solution and its neighborhood.
|
public static String getJson(LinkedList<ErlangBWeb.ErlangBResults> results)
result
has structure { "NumServers":n, "Block":block}.
The blocking probability is returned in percentage unit.
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 B evaluation resultspublic static String getJson(LinkedList<ErlangBWeb.ErlangBResults> results, int requiredServers)
getJson(java.util.LinkedList)
except with an additional value that contains the required number of servers.
The JSON structure is:
{"Results":[result, result, ...], "RequiredServers":requiredServers }
where result
has structure { "NumServers":n, "Block":block }.
The blocking probability is returned in percentage unit.
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 B evaluation resultsrequiredServers
- the number of servers required to satisfy the service level targetpublic static String multiEvalErlangB(String arrivalRateP, String arrivalRateUnitP, String avgServiceTimeP, String avgServiceTimeUnitP, String numServerP, String serverRangeP)
Use the parameter serverRangeP
to evaluate multiple numbers of servers around the
given numServerP
parameter.
The returned string is built by getJson(java.util.LinkedList)
.
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 timenumServerP
- number of servers (must be integer)serverRangeP
- the range for multiple Erlang B evaluations. Let r be the range and n the number of
servers parameter, this program will evaluate Erlang B from n - r to n + r servers,
except if the number of servers is below 1.public static String multiEvalMinServers(String arrivalRateP, String arrivalRateUnitP, String avgServiceTimeP, String avgServiceTimeUnitP, String targetBlockP, String serverRangeP)
java.lang.String, java.lang.String, java.lang.String, java.lang.String, java.lang.String)
It evaluates the performance measures using Erlang B 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.
Use the parameter serverRangeP
to evaluate multiple numbers of servers around the
given numServerP
parameter.
The returned string is built by 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 timetargetBlockP
- the maximum blocking probability threshold in percentage unit.
This parameter must be between 0 and 100, inclusively.serverRangeP
- the range for multiple Erlang B evaluations. Let r be the range and n the number of
servers parameter, this program will evaluate Erlang B from n - r to n + r servers,
except if the number of servers is below 1.public static void main(String[] args)
args
- see the method description