public static double[] erlangBresources(double blockingProbability, double totalTraffic) {

		double[] ret = new double[8];
		long counter = 1;
		double lastProb = Double.NaN;
		double prob = Double.NaN;
		boolean test = true;
		while (test) {
			prob = Stat.erlangBprobability(totalTraffic, counter);
			if (prob <= blockingProbability) {
				ret[0] = counter;
				ret[1] = prob;
				ret[2] = Stat.erlangBload(blockingProbability, counter);
				ret[3] = (counter - 1);
				ret[4] = lastProb;
				ret[5] = Stat.erlangBload(blockingProbability, counter - 1);
				ret[6] = blockingProbability;
				ret[7] = totalTraffic;
				test = false;
			} else {
				lastProb = prob;
				counter++;
				if (counter == Integer.MAX_VALUE) {
					System.out.println("Method erlangBresources: no solution found below " + Long.MAX_VALUE + "resources");
					for (int i = 0; i < 8; i++)
						ret[i] = Double.NaN;
					test = false;
				}
			}
		}
		return ret;
	}