//add class
JobClass[] classes = new JobClass[1];
classes[0] = new JobClass("prima");
long simTime = 200;
Simulation sim = new Simulation(-1, "SimulationWithTimer", simTime);
sim.addClasses(classes);
//terminal
RoundRobinStrategy[] rrs_term = new RoundRobinStrategy[1];
rrs_term[0] = new RoundRobinStrategy();
int[] numJobs = { 6 };
ServiceTimeStrategy[] ds = { new ServiceTimeStrategy(DelayExp[0], DelayPar[0]) };
sim.addNode("terminal", new Terminal(numJobs), new Delay(ds), new Router(rrs_term));
//server
ServiceStrategy[] serv_strat = new ServiceStrategy[1];
serv_strat[0] = new ServiceTimeStrategy(serverExp[0], serverPar[0]);
RoundRobinStrategy[] rrs_serv = new RoundRobinStrategy[1];
rrs_serv[0] = new RoundRobinStrategy();
sim.addNode("server", new Queue(-1, false, null, null), new Server(1, null, serv_strat), new Router(rrs_serv));
//connections
sim.addConnection("terminal", "server");
sim.addConnection("server", "terminal");
//measure
jmt.engine.dataAnalysis.Measure mis1 = new jmt.engine.dataAnalysis.Measure("queuelength_s.out", .1, .1, 1000000, false, null);
jmt.engine.dataAnalysis.Measure mis11 = new jmt.engine.dataAnalysis.Measure("queuelength_t.out", .1, .1, 1000000, false, null);
jmt.engine.dataAnalysis.Measure mis2 = new jmt.engine.dataAnalysis.Measure("utilization_s.out", .1, .1, 1000000, false, null);
jmt.engine.dataAnalysis.Measure mis3 = new InverseMeasure("throughput_s.out", .1, .1, 1000000, false);
jmt.engine.dataAnalysis.Measure mis4 = new jmt.engine.dataAnalysis.Measure("queuetime_s.out", .1, .1, 1000000, false, null);
jmt.engine.dataAnalysis.Measure mis5 = new jmt.engine.dataAnalysis.Measure("residencetime_s.out", .1, .1, 1000000, false, null);
jmt.engine.dataAnalysis.Measure mis6 = new jmt.engine.dataAnalysis.Measure("utilization_t.out", .1, .1, 1000000, false, null);
jmt.engine.dataAnalysis.Measure mis7 = new InverseMeasure("throughput_t.out", .1, .1, 1000000, false);
jmt.engine.dataAnalysis.Measure mis8 = new jmt.engine.dataAnalysis.Measure("residencetime_t.out", .1, .1, 1000000, false, null);
jmt.engine.dataAnalysis.Measure mis9 = new jmt.engine.dataAnalysis.Measure("responsetime_s.out", .1, .1, 1000000, false, null);
jmt.engine.dataAnalysis.Measure mis10 = new jmt.engine.dataAnalysis.Measure("responsetime_t.out", .1, .1, 1000000, false, null);
int queue_l = SimConstants.QUEUE_LENGTH;
int utiliz = SimConstants.UTILIZATION;
int through = SimConstants.THROUGHPUT;
int queue_t = SimConstants.QUEUE_TIME;
int resid_t = SimConstants.RESIDENCE_TIME;;
int resp_t = SimConstants.RESPONSE_TIME;
//sim.addMeasure(queue_l, "server", mis1, classes[0].getName());
//sim.addMeasure(queue_l, "terminal", mis11, classes[0].getName());
sim.addMeasure(utiliz, "server", mis2, classes[0].getName());
sim.addMeasure(utiliz, "terminal", mis6, classes[0].getName());
sim.addMeasure(through, "server", mis3, classes[0].getName());
sim.addMeasure(through, "terminal", mis7, classes[0].getName());
//sim.addMeasure(resid_t, "server", mis5, classes[0].getName());
//sim.addMeasure(resid_t, "terminal", mis8, classes[0].getName());
//sim.addMeasure(resp_t, "server", mis9, classes[0].getName());
//sim.addMeasure(resp_t, "terminal", mis10, classes[0].getName());
sim.initialize();
sim.run();
System.out.println("tot time = " + NetSystem.getElapsedTime());
} catch (Exception e) {
e.printStackTrace();