Search in sources :

Example 1 with Neighbourhood

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

the class NeighbourhoodTest method testNorthNorthNeighbour.

@Test
public void testNorthNorthNeighbour() {
    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(8);
    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 2 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 3 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 4 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 5 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)

Aggregations

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