{
//refresh(); //ESTO NO ES NECESARIO EN UN PRINCIPIO, PERO SE PODRIA EVALUAR ENVIARLO
Infrastructure infra = model.getInfrastructure();
Node[] nodes = infra.getAllNodes();
JAXBStatisticsUtils su = new JAXBStatisticsUtils();
//Tracks tracks = su.makeNewTracks("");
for (int i = 0; i < nodes.length; i++) {
Node node = nodes[i];
try {
Drivelane[] lanes = node.getInboundLanes();
for (int j = 0; j < lanes.length; j++) {
Drivelane drivelane = lanes[j];
Drivelane.DrivelaneStatistics dls = drivelane.getStatistics();
Track track = su.makeNewTrack(Integer.toString(drivelane.getId()),dls.getAvgNumberRUWaiting());
su.addItem(track);
drivelane.initStats();
}
} catch (InfraException e) {
e.printStackTrace();
}
}
try{
AverageSender sender = AverageSenderFactory.getAverageSender(rb);
PrintWriter out = sender.getSender();
su.persistTracks(out);
sender.closeSender(out);
}
catch(Exception e){
System.out.println("Simulator runtime data could not be sent. Please check SenderFactory being used");
System.out.println("Causes could be (if using socket factory), incorrect port number or host");