class StagnationRestart implements IndividualSetListener, OptimizerIterationListener {

	@Override
	public void iterationComplete(int iteration) {
		this.iteration = iteration;

		for (Individual in0 : population) {
			for (Individual in1 : archive) {
				if (in0.getObjectives().dominates(in1.getObjectives())) {
					// new individuals are found
					lastUpdate = iteration;
				}
			}
		}

		archive.update(population);

		if (iteration - lastUpdate > diff) {
			// the case where no individuals were found for the last diff
			// generations
			lastUpdate = iteration;
			archive.clear();
			population.clear();
		}

	}

	@Inject public  StagnationRestart(Population population,
			@Constant(value = "maximalNumberStagnatingGenerations", namespace = StagnationRestart.class) int diff);

}