public void writeResultsForSelectedStopIds( final String filename, final Counts occupCounts, final Collection<Id> stopIds) { SimpleWriter writer = new SimpleWriter(filename); final String TAB = "\t"; final String NL = "\n"; // write header writer.write("stopId\t"); for (int i = 0; i < 24; i++) { writer.write("oc" + i + "-" + (i + 1) + TAB); } for (int i = 0; i < 24; i++) { writer.write("scalSim" + i + "-" + (i + 1) + TAB); } writer.write("coordinate\tcsId\n"); // write content for (Id stopId : stopIds) { // get count data Count count = occupCounts.getCounts().get(stopId); if (!occupCounts.getCounts().containsKey(stopId)) { continue; } // get sim-Values int[] ocuppancy = this.occupancies.get(stopId); writer.write(stopId.toString() + TAB); for (int i = 0; i < ocuppancy.length; i++) { Volume v = count.getVolume(i + 1); if (v != null) { writer.write(v.getValue() + TAB); } else { writer.write("n/a" + TAB); } } for (int i = 0; i < ocuppancy.length; i++) { writer.write((ocuppancy != null ? ocuppancy[i] : 0) + TAB); } writer.write(count.getCoord().toString() + TAB + count.getCsId() + NL); } writer.write(this.occupancyRecord.toString()); writer.close(); }