Search in sources :

Example 6 with Neighbourhood

use of org.evosuite.ga.Neighbourhood in project evosuite-plus-plus by llmhyy.

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 7 with Neighbourhood

use of org.evosuite.ga.Neighbourhood in project evosuite-plus-plus by llmhyy.

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)

Example 8 with Neighbourhood

use of org.evosuite.ga.Neighbourhood in project evosuite-plus-plus by llmhyy.

the class NeighbourhoodTest method testMostNorthWestNeighbour.

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

Example 9 with Neighbourhood

use of org.evosuite.ga.Neighbourhood in project evosuite-plus-plus by llmhyy.

the class NeighbourhoodTest method testNorthNeighbour.

@Test
public void testNorthNeighbour() {
    this.constructPopulation();
    Neighbourhood<Chromosome> neighbourhood = new Neighbourhood<>(Properties.POPULATION);
    List<Chromosome> neighbors = new ArrayList<>();
    neighbors = neighbourhood.linearFive(population, 5);
    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 10 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)

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