Search in sources :

Example 16 with Neighbourhood

use of org.evosuite.ga.Neighbourhood in project evosuite by EvoSuite.

the class NeighbourhoodTest method testEastNeighbour.

@Test
public void testEastNeighbour() {
    this.constructPopulation();
    Neighbourhood<Chromosome> neighbourhood = new Neighbourhood<>(Properties.POPULATION);
    List<Chromosome> neighbors = new ArrayList<>();
    neighbors = neighbourhood.linearFive(population, 5);
    Chromosome exepcted_individual = population.get(6);
    Chromosome returned_individual = neighbors.get(2);
    assertEquals(exepcted_individual, returned_individual);
}
Also used : Neighbourhood(org.evosuite.ga.Neighbourhood) ArrayList(java.util.ArrayList) Chromosome(org.evosuite.ga.Chromosome) TestSuiteChromosome(org.evosuite.testsuite.TestSuiteChromosome) Test(org.junit.Test)

Example 17 with Neighbourhood

use of org.evosuite.ga.Neighbourhood in project evosuite by EvoSuite.

the class NeighbourhoodTest method testSouthWestNeighbour.

@Test
public void testSouthWestNeighbour() {
    this.constructPopulation();
    Neighbourhood<Chromosome> neighbourhood = new Neighbourhood<>(Properties.POPULATION);
    List<Chromosome> neighbors = new ArrayList<>();
    neighbors = neighbourhood.compactNine(population, 5);
    Chromosome exepcted_individual = population.get(8);
    Chromosome returned_individual = neighbors.get(5);
    assertEquals(exepcted_individual, returned_individual);
}
Also used : Neighbourhood(org.evosuite.ga.Neighbourhood) ArrayList(java.util.ArrayList) Chromosome(org.evosuite.ga.Chromosome) TestSuiteChromosome(org.evosuite.testsuite.TestSuiteChromosome) Test(org.junit.Test)

Example 18 with Neighbourhood

use of org.evosuite.ga.Neighbourhood in project evosuite by EvoSuite.

the class NeighbourhoodTest method testSouthNeighbour.

@Test
public void testSouthNeighbour() {
    this.constructPopulation();
    Neighbourhood<Chromosome> neighbourhood = new Neighbourhood<>(Properties.POPULATION);
    List<Chromosome> neighbors = new ArrayList<>();
    neighbors = neighbourhood.linearFive(population, 5);
    Chromosome exepcted_individual = population.get(9);
    Chromosome returned_individual = neighbors.get(1);
    assertEquals(exepcted_individual, returned_individual);
}
Also used : Neighbourhood(org.evosuite.ga.Neighbourhood) ArrayList(java.util.ArrayList) Chromosome(org.evosuite.ga.Chromosome) TestSuiteChromosome(org.evosuite.testsuite.TestSuiteChromosome) Test(org.junit.Test)

Example 19 with Neighbourhood

use of org.evosuite.ga.Neighbourhood in project evosuite by EvoSuite.

the class NeighbourhoodTest method testSouthEastNeighbour.

@Test
public void testSouthEastNeighbour() {
    this.constructPopulation();
    Neighbourhood<Chromosome> neighbourhood = new Neighbourhood<>(Properties.POPULATION);
    List<Chromosome> neighbors = new ArrayList<>();
    neighbors = neighbourhood.compactNine(population, 5);
    Chromosome exepcted_individual = population.get(10);
    Chromosome returned_individual = neighbors.get(7);
    assertEquals(exepcted_individual, returned_individual);
}
Also used : Neighbourhood(org.evosuite.ga.Neighbourhood) ArrayList(java.util.ArrayList) Chromosome(org.evosuite.ga.Chromosome) TestSuiteChromosome(org.evosuite.testsuite.TestSuiteChromosome) Test(org.junit.Test)

Example 20 with Neighbourhood

use of org.evosuite.ga.Neighbourhood in project evosuite by EvoSuite.

the class NeighbourhoodTest method testNorthEastNeighbour.

@Test
public void testNorthEastNeighbour() {
    this.constructPopulation();
    Neighbourhood<Chromosome> neighbourhood = new Neighbourhood<>(Properties.POPULATION);
    List<Chromosome> neighbors = new ArrayList<>();
    neighbors = neighbourhood.compactNine(population, 5);
    Chromosome exepcted_individual = population.get(2);
    Chromosome returned_individual = neighbors.get(6);
    assertEquals(exepcted_individual, returned_individual);
}
Also used : Neighbourhood(org.evosuite.ga.Neighbourhood) ArrayList(java.util.ArrayList) Chromosome(org.evosuite.ga.Chromosome) TestSuiteChromosome(org.evosuite.testsuite.TestSuiteChromosome) Test(org.junit.Test)

Aggregations

ArrayList (java.util.ArrayList)40 Chromosome (org.evosuite.ga.Chromosome)40 Neighbourhood (org.evosuite.ga.Neighbourhood)40 TestSuiteChromosome (org.evosuite.testsuite.TestSuiteChromosome)40 Test (org.junit.Test)40