public QParameterSet generateQParameterSet() { QParameterSet q = new QParameterSet(); q.mtba = myMTBACDF.getValue(); q.numServers = (int) myServerCDF.getValue(); q.rho = myRhoCDF.getValue(); q.mst = q.rho * q.mtba * q.numServers; matchDistribution(q, ARRIVAL); matchDistribution(q, SERVICE); return (q); }
private void matchDistribution(QParameterSet q, int processType) { double mean = 0.0; double p1 = 0.0; double p2 = 0.0; double p3 = 0.0; double[] param = new double[3]; Distribution d; int type = (int) myDCDF.getValue(); if (processType == ARRIVAL) { q.acdfType = type; q.acdf = (Distribution) myArrivalCDFs.get(q.acdfType - 1); d = q.acdf; mean = q.mtba; } else { q.scdfType = type; q.scdf = (Distribution) myServiceCDFs.get(q.scdfType - 1); d = q.scdf; mean = q.mst; } switch (type) { case EXPONENTIAL: matchExponential(mean, (Exponential) d); param = d.getParameters(); p1 = param[0]; break; case UNIFORM: matchUniform(mean, (Uniform) d); param = d.getParameters(); p1 = param[0]; p2 = param[1]; break; case GAMMA: matchGamma(mean, (Gamma) d); param = d.getParameters(); p1 = param[0]; p2 = param[1]; break; case WEIBULL: matchWeibull(mean, (Weibull) d); param = d.getParameters(); p1 = param[0]; p2 = param[1]; break; case TRIANGULAR: matchTriangular(mean, (Triangular) d); param = d.getParameters(); p1 = param[0]; p2 = param[1]; p3 = param[2]; break; case LOGNORMAL: matchLognormal(mean, (Lognormal) d); param = d.getParameters(); p1 = param[0]; p2 = param[1]; break; } double var = d.getVariance(); double cv2 = var / (mean * mean); if (processType == ARRIVAL) { q.c2va = cv2; q.aP1 = p1; q.aP2 = p2; q.aP3 = p3; } else { q.c2vs = cv2; q.sP1 = p1; q.sP2 = p2; q.sP3 = p3; } }