test_class.file: opendse-optimization/src/test/java/net/sf/opendse/optimization/StagnationRestartTest.java
test_class.identifier: StagnationRestartTest
test_case.body: @Test
  	public void testNoStagnation() {
  		Population population = new Population();
  		Individual indi1 = new MockIndividual(false);
  		Individual indi2 = new MockIndividual(false);
  		population.add(indi1);
  		population.add(indi2);
  		StagnationRestart restart = new StagnationRestart(population, 20);
  		restart.archive.add(indi1);
  		restart.archive.add(indi2);
  		assertEquals(0, restart.lastUpdate);
  		restart.iterationComplete(21);
  		assertEquals(21, restart.lastUpdate);
  		assertFalse(population.isEmpty());
  		assertFalse(restart.archive.isEmpty());
  	}
test_case.class_method_signature: StagnationRestartTest.testNoStagnation()
test_case.full_signature: @Test public void testNoStagnation()
test_case.identifier: testNoStagnation
test_case.invocations: add add add add assertEquals iterationComplete assertEquals assertFalse isEmpty assertFalse isEmpty
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testNoStagnation()
focal_class.declarator: archive = new CrowdingArchive(100)
focal_class.modifier: protected final
focal_class.original_string: protected final Archive archive = new CrowdingArchive(100);
focal_class.type: Archive
focal_class.var_name: archive
focal_class.declarator: population
focal_class.modifier: protected final
focal_class.original_string: protected final Population population;
focal_class.type: Population
focal_class.var_name: population
focal_class.declarator: iteration = 0
focal_class.modifier: protected
focal_class.original_string: protected int iteration = 0;
focal_class.type: int
focal_class.var_name: iteration
focal_class.declarator: lastUpdate = 0
focal_class.modifier: protected
focal_class.original_string: protected int lastUpdate = 0;
focal_class.type: int
focal_class.var_name: lastUpdate
focal_class.declarator: diff
focal_class.modifier: protected final
focal_class.original_string: protected final int diff;
focal_class.type: int
focal_class.var_name: diff
focal_class.file: opendse-optimization/src/main/java/net/sf/opendse/optimization/StagnationRestart.java
focal_class.identifier: StagnationRestart
focal_class.interfaces: implements IndividualSetListener, OptimizerIterationListener
focal_class.class_method_signature: StagnationRestart.StagnationRestart(Population population,
  			@Constant(value = "maximalNumberStagnatingGenerations", namespace = StagnationRestart.class) int diff)
focal_class.full_signature: @Inject public  StagnationRestart(Population population,
  			@Constant(value = "maximalNumberStagnatingGenerations", namespace = StagnationRestart.class) int diff)
focal_class.identifier: StagnationRestart
focal_class.modifiers: @Inject public
focal_class.parameters: (Population population,
  			@Constant(value = "maximalNumberStagnatingGenerations", namespace = StagnationRestart.class) int diff)
focal_class.signature:  StagnationRestart(Population population,
  			@Constant(value = "maximalNumberStagnatingGenerations", namespace = StagnationRestart.class) int diff)
focal_class.class_method_signature: StagnationRestart.iterationComplete(int iteration)
focal_class.full_signature: @Override public void iterationComplete(int iteration)
focal_class.identifier: iterationComplete
focal_class.modifiers: @Override public
focal_class.parameters: (int iteration)
focal_class.return: void
focal_class.signature: void iterationComplete(int iteration)
focal_class.class_method_signature: StagnationRestart.individualAdded(IndividualSet collection, Individual individual)
focal_class.full_signature: @Override public void individualAdded(IndividualSet collection, Individual individual)
focal_class.identifier: individualAdded
focal_class.modifiers: @Override public
focal_class.parameters: (IndividualSet collection, Individual individual)
focal_class.return: void
focal_class.signature: void individualAdded(IndividualSet collection, Individual individual)
focal_class.class_method_signature: StagnationRestart.individualRemoved(IndividualSet collection, Individual individual)
focal_class.full_signature: @Override public void individualRemoved(IndividualSet collection, Individual individual)
focal_class.identifier: individualRemoved
focal_class.modifiers: @Override public
focal_class.parameters: (IndividualSet collection, Individual individual)
focal_class.return: void
focal_class.signature: void individualRemoved(IndividualSet collection, Individual individual)
focal_method.body: @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();
  		}
  
  	}
focal_method.class_method_signature: StagnationRestart.iterationComplete(int iteration)
focal_method.full_signature: @Override public void iterationComplete(int iteration)
focal_method.identifier: iterationComplete
focal_method.invocations: dominates getObjectives getObjectives update clear clear
focal_method.modifiers: @Override public
focal_method.parameters: (int iteration)
focal_method.return: void
focal_method.signature: void iterationComplete(int iteration)