@Override
	public void run() {
		int selected = 0;

		ArrayList<MonitoredAS> monitoredASs = new ArrayList<MonitoredAS>(
				allUpdates.keySet());

		for (int i = start; i <= end; i++) {

			MonitoredAS monitoredAS = monitoredASs.get(i - 1);

			SingleASspikes spikes = allUpdates.get(monitoredAS);

			if (spikes.getCurrentUpdateSum() == 0) {
				continue;
			}

			for (Long time = spikes.getCurrentMinTime(); time <= spikes
					.getCurrentMaxTime(); time++) {
				if (spikes.hasSpikeAtTime(time)) {

					int size = spikes.getSpikeAtTime(time).getSpikeSize();
					if ((size < maxSize) && (size >= minSize)) {// select spike

						// Attention! this part of code
						// "contains a sequence of calls to a concurrent" hash
						// map. However, it should not be a problem since
						// different threads work with different monitoredASs

						// check if there are already selected spikes from this
						// monitoredAS
						if (!selectedSpikesWithPredefinedSize
								.containsKey(monitoredAS)) {
							// create hash map entry for monitoredAS with empty
							// spikes
							// I will add spikes at the code below
							selectedSpikesWithPredefinedSize.put(monitoredAS,
									new SingleASspikes());// need
							// to
							// copy
							// monitoredAS?
						}

						// copy spike object
						ArrayList<Destination> destinations = spikes
								.getSpikeAtTime(time).copyPrefixSet();
						Spike selectedSpike = new Spike(destinations);

						// add spike to selected (entry with monitored AS is
						// already created)
						selectedSpikesWithPredefinedSize.get(monitoredAS)
								.addSpike(time, selectedSpike);

						selected++;
					}
				}
			}
		}

		logger.info(selected + " spikes with size from " + minSize + " to "
				+ (maxSize - 1) + " selected by current thread.");
	}