import umontreal.iro.lecuyer.rng.*; import umontreal.iro.lecuyer.randvar.*; import umontreal.iro.lecuyer.probdist.*; import umontreal.iro.lecuyer.stat.Tally; import umontreal.iro.lecuyer.simevents.*; import java.io.*; import umontreal.iro.lecuyer.util.PrintfFormat; // Sensitivity analysis w.r.t. small change in mean service time. public class CallCenterSens extends CallCenterDisc2 { Event nextArrival = new Arrival(); // Redefined because Callc and Arrival have // been changed. double gammaBase; // Original gamma. Tally statService1 = new Tally ("stats on service level for config.1"); Tally statDiffIndep = new Tally ("stats on difference with IRNs"); // Tally statDiffCRN = new Tally ("stats on difference with CRNs"); Tally statDiffCRNac = new Tally ("stats on difference with CRNs (a + c)"); Tally statDiffCRNad = new Tally ("stats on difference with CRNs (a + d)"); Tally statDiffCRNbc = new Tally ("stats on difference with CRNs (b + c)"); Tally statDiffCRNbd = new Tally ("stats on difference with CRNs (b + d)"); public CallCenterSens (String fileName, String fileName2) throws IOException { super (fileName, fileName2); gammaBase = gamma; } public void setGamma (double gamma) { this.gamma = gamma; //genServ = new GammaGen (genServ.getStream(), // new GammaDist (alpha, gamma)); genServ = new GammaAcceptanceRejectionGen (genServ.getStream(), new RandMrg(), new GammaDist (alpha, gamma)); } // Compares systems with (1/gamma = 1/gammaBase) // and (1/gamma = 1/gammaBase - delta). // Note: mean service time = alpha/gamma. public void simulateDiffCRN (int n, double delta, Tally statDiffCRN, boolean allServices, boolean allPatience) { this.allServices = allServices; this.allPatience = allPatience; double value1, value2; statService1.init(); statDiffIndep.init(); statDiffCRN.init(); for (int i=0; i