Search in sources :

Example 11 with Neighbourhood

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

the class NeighbourhoodTest method testMostSouthEastNeighbour.

@Test
public void testMostSouthEastNeighbour() {
    this.constructPopulation();
    Neighbourhood<Chromosome> neighbourhood = new Neighbourhood<>(Properties.POPULATION);
    List<Chromosome> neighbors = new ArrayList<>();
    neighbors = neighbourhood.CompactThirteen(population, 15);
    Chromosome exepcted_individual = population.get(0);
    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 12 with Neighbourhood

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

the class NeighbourhoodTest method testEastEastNeighbour.

@Test
public void testEastEastNeighbour() {
    this.constructPopulation();
    Neighbourhood<Chromosome> neighbourhood = new Neighbourhood<>(Properties.POPULATION);
    List<Chromosome> neighbors = new ArrayList<>();
    neighbors = neighbourhood.CompactThirteen(population, 10);
    Chromosome exepcted_individual = population.get(8);
    Chromosome returned_individual = neighbors.get(10);
    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 13 with Neighbourhood

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

the class NeighbourhoodTest method testSouthSouthNeighbour.

@Test
public void testSouthSouthNeighbour() {
    this.constructPopulation();
    Neighbourhood<Chromosome> neighbourhood = new Neighbourhood<>(Properties.POPULATION);
    List<Chromosome> neighbors = new ArrayList<>();
    neighbors = neighbourhood.CompactThirteen(population, 10);
    Chromosome exepcted_individual = population.get(2);
    Chromosome returned_individual = neighbors.get(9);
    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 14 with Neighbourhood

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

the class NeighbourhoodTest method testRingTopology_leftNeighbour.

@Test
public void testRingTopology_leftNeighbour() {
    this.constructPopulation();
    Neighbourhood<Chromosome> neighbourhood = new Neighbourhood<>(Properties.POPULATION);
    List<Chromosome> neighbors = new ArrayList<>();
    neighbors = neighbourhood.ringTopology(population, 2);
    Chromosome exepcted_individual = population.get(1);
    Chromosome returned_individual = neighbors.get(0);
    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 15 with Neighbourhood

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

the class NeighbourhoodTest method testNorthWestNeighbour.

@Test
public void testNorthWestNeighbour() {
    this.constructPopulation();
    Neighbourhood<Chromosome> neighbourhood = new Neighbourhood<>(Properties.POPULATION);
    List<Chromosome> neighbors = new ArrayList<>();
    neighbors = neighbourhood.compactNine(population, 5);
    Chromosome exepcted_individual = population.get(0);
    Chromosome returned_individual = neighbors.get(4);
    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