public void readEvents(String filename) { EventsManager events = EventsUtils.createEventsManager(); Collections.sort(this.timeSteps); this.handlerList = new LinkedList<DelayHandler>(); for (int i = 0; i < this.timeSteps.size(); i++) { if (i == 0) { DelayHandler handler = new DelayHandler(0.0, this.timeSteps.get(i).doubleValue()); events.addHandler(handler); this.handlerList.add(handler); } else { DelayHandler handler = new DelayHandler( this.timeSteps.get(i - 1).doubleValue(), this.timeSteps.get(i).doubleValue()); events.addHandler(handler); this.handlerList.add(handler); } } DelayHandler handler = new DelayHandler( this.timeSteps.get(this.timeSteps.size() - 1).doubleValue(), Double.MAX_VALUE); events.addHandler(handler); this.handlerList.add(handler); EventsReaderXMLv1 reader = new EventsReaderXMLv1(events); reader.readFile(filename); }
private void splitEventsToMultipleSortedFiles() { EventsManager events = EventsUtils.createEventsManager(); SplitEventsToMultipleSortedFiles setmsf = new SplitEventsToMultipleSortedFiles(outputPath + "\\sorted_", 100000); events.addHandler(setmsf); EventsReaderXMLv1 reader = new EventsReaderXMLv1(events); reader.setValidating(false); reader.parse(inFileName); setmsf.writeQueue(); setmsf.closeFile(); }
public static void main(String[] args) { // String eventsFile="C:/data/parkingSearch/psim/berlin/ITERS/it.50/50.events.xml.gz"; // String eventsFile="C:/data/parkingSearch/psim/output/all/events.xml.gz"; // String // eventsFile="H:/data/experiments/TRBAug2011/runs/ktiRun24/output/ITERS/it.50/50.events.xml.gz"; String eventsFile = "C:/data/parkingSearch/psim/zurich/output/basic output with 300 sec bins/events.xml.gz"; EventsManager events = EventsUtils.createEventsManager(); SingleAgentEventsPrinter singleAgentEventsPrinter = new SingleAgentEventsPrinter(Id.create("65802", Person.class)); events.addHandler(singleAgentEventsPrinter); // EventsReaderTXTv1 reader = new EventsReaderTXTv1(events); // reader.readFile(eventsFile); EventsReaderXMLv1 reader = new EventsReaderXMLv1(events); reader.parse(eventsFile); }