private void writeCurrentClassificationResultsForOneInterval(
			String classificationResultsFilename, int interval)
			throws IOException {

		// find maxHop
		byte maxHop = 0;
		for (byte hop : this.results.get(interval).getCorrelatedSpikesStats()
				.keySet()) {
			if (maxHop < hop) {
				maxHop = hop;
			}
		}

		// create folders if needed
		if (classificationResultsFilename.lastIndexOf("/") != -1) {
			File file = new File(classificationResultsFilename.substring(0,
					classificationResultsFilename.lastIndexOf("/")));
			file.mkdirs();
		}

		// prepare file
		File file = new File(classificationResultsFilename);
		FileWriter fwr = new FileWriter(file, true);
		BufferedWriter bwr = new BufferedWriter(fwr);

		if (!file.exists()) {
			// write header
			bwr.write("Spike_size\tSingle_0.33\tSingleUpdates_0.33\tSingle_0.66\tSingleUpdates_0.66\tSingle_1\tSingleUpdates_1");
			for (byte hop = 1; hop <= maxHop; hop++) {
				bwr.write("\tDuplicated_" + hop + "_hop\tDuplicatedUpdates_"
						+ hop + "_hop");
			}
		}

		// start a new line
		bwr.write("\n");

		// write spike sizes
		bwr.write("" + (interval * 100 - 100) + ".." + (interval * 100 - 1));

		// write stats for single spikes with visibility <= 0.33
		bwr.write("\t"
				+ this.results.get(interval).getSingleSpikesMax033Visible()
						.getTotalNumberOfSpikes()
				+ "\t"
				+ this.results.get(interval).getSingleSpikesMax033Visible()
						.getTotalNumberOfPrefixes());
		// write stats for single spikes with (0.33 < visibility <= 0.66)
		bwr.write("\t"
				+ this.results.get(interval).getSingleSpikesMax066Visible()
						.getTotalNumberOfSpikes()
				+ "\t"
				+ this.results.get(interval).getSingleSpikesMax066Visible()
						.getTotalNumberOfPrefixes());
		// write stats for single spikes with (0.66 < visibility <= 1)
		bwr.write("\t"
				+ this.results.get(interval).getSingleSpikes100Visible()
						.getTotalNumberOfSpikes()
				+ "\t"
				+ this.results.get(interval).getSingleSpikes100Visible()
						.getTotalNumberOfPrefixes());

		// write statistics for correlated spikes for every hop
		for (byte hop = 1; hop <= maxHop; hop++) {
			SpikeClassStats stats = this.results.get(interval)
					.getCorrelatedSpikesStats().get(hop);
			if (stats != null) {
				bwr.write("\t" + stats.getTotalNumberOfSpikes() + "\t"
						+ stats.getTotalNumberOfPrefixes());
			} else {
				bwr.write("\t" + 0 + "\t" + 0);
			}
		}

		bwr.close();
		fwr.close();
	}