try {
//add class
JobClass[] classes = new JobClass[1];
classes[0] = new JobClass("prima");
Simulation sim = new Simulation(-1, testName);
sim.addClasses(classes);
//terminal
RandomStrategy[] rrs_term = new RandomStrategy[1];
rrs_term[0] = new RandomStrategy();
int[] numJobs = { N }; //variable population
ServiceTimeStrategy[] ds = { new ServiceTimeStrategy(DelayExp[0], DelayPar[0]) };
sim.addNode("terminal", new Terminal(numJobs), new Delay(ds), new Router(rrs_term));
//server 1
ServiceStrategy[] serv_strat1 = new ServiceStrategy[1];
serv_strat1[0] = new ServiceTimeStrategy(serverExp1[0], serverPar1[0]);
RandomStrategy[] rrs_serv1 = new RandomStrategy[1];
rrs_serv1[0] = new RandomStrategy();
sim.addNode("server1", new Queue(-1, false, null, null), new Server(1, null, serv_strat1), new Router(rrs_serv1));
//server 2
ServiceStrategy[] serv_strat2 = new ServiceStrategy[1];
serv_strat2[0] = new ServiceTimeStrategy(serverExp2[0], serverPar2[0]);
RandomStrategy[] rrs_serv2 = new RandomStrategy[1];
rrs_serv2[0] = new RandomStrategy();
sim.addNode("server2", new Queue(-1, false, null, null), new Server(1, null, serv_strat2), new Router(rrs_serv2));
//connections
sim.addConnection("terminal", "server1");
sim.addConnection("server1", "server2");
sim.addConnection("server2", "terminal");
//measure
jmt.engine.dataAnalysis.Measure mis3_s1 = new InverseMeasure(testName + "_x1.out", .1, .1, 1000000, true);
jmt.engine.dataAnalysis.Measure mis3_s2 = new InverseMeasure(testName + "_x2.out", .1, .1, 1000000, true);
int through = SimConstants.THROUGHPUT;
sim.addMeasure(through, "server1", mis3_s1, classes[0].getName());
//sim.addMeasure(through, "server2", mis3_s2, classes[0].getName());
sim.initialize();
sim.run();
System.out.println("tot time = " + NetSystem.getElapsedTime());
} catch (Exception e) {
e.printStackTrace();