T - public abstract class AbstractMOSA<T extends Chromosome> extends GeneticAlgorithm<T>
| Modifier and Type | Field and Description |
|---|---|
protected Ranking<T> |
ranking
Selected ranking strategy
|
protected SelectionFunction<T> |
selectionFunction
Selection function to select parents
|
protected TestSuiteFitnessFunction |
suiteFitness
keep track of overall suite fitness and coverage
|
archive, bloatControl, chromosomeFactory, crossoverFunction, currentIteration, fitnessFunctions, listeners, localObjective, localSearchProbability, population, populationLimit, stoppingConditions| Constructor and Description |
|---|
AbstractMOSA(ChromosomeFactory<T> factory)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
areEqual(T test1,
T test2)
This method verifies whether two TestCromosome contain
the same test case.
|
protected List<T> |
breedNextGeneration()
This method is used to generate new individuals (offsprings) from
the current population
|
protected void |
calculateFitness()
Calculate fitness for the whole population
|
protected abstract void |
calculateFitness(T c)
This method computes the fitness scores only for the current goals
|
void |
clearCachedResults(T chromosome)
This method clears the cached results for a specific chromosome (e.g., fitness function
values computed in previous generations).
|
protected abstract List<T> |
getArchive() |
List<T> |
getBestIndividuals()
Return the individual(s) with the highest fitChromosomeess
|
abstract Set<FitnessFunction<T>> |
getCoveredGoals() |
protected abstract List<T> |
getFinalTestSuite() |
protected List<T> |
getNonDominatedSolutions(List<T> solutions)
This method extracts non-dominated solutions (tests) according to all covered goal (e.g., branches)
|
void |
initializePopulation()
Set up initial population
|
protected void |
notifyEvaluation(Chromosome chromosome)
Notify all search listeners of fitness evaluation
|
protected abstract double |
numberOfCoveredTargets() |
boolean |
removeUnusedVariables(T chromosome)
When a test case is changed via crossover and/or mutation, it can contains some
primitive variables that are not used as input (or to store the output) of method calls.
|
addBloatControl, addFitnessFunction, addFitnessFunctions, addListener, addStoppingCondition, applyLocalSearch, calculateFitnessAndSortPopulation, clearPopulation, disableFirstSecondaryCriterion, elitism, enableFirstSecondaryCriterion, evolve, generateInitialPopulation, generateRandomPopulation, generateSolution, getAge, getBestIndividual, getBudgetString, getFitnessFunction, getFitnessFunctions, getNumberOfFitnessFunctions, getPopulation, getPopulationSize, getSelectionFunction, getStoppingConditions, isBetterOrEqual, isFinished, isNextPopulationFull, isTooLong, notifyIteration, notifyMutation, notifySearchFinished, notifySearchStarted, printBudget, randomism, removeListener, removeStoppingCondition, resetStoppingConditions, setArchive, setBloatControl, setChromosomeFactory, setCrossOverFunction, setPopulationLimit, setSelectionFunction, setStoppingCondition, setStoppingConditionLimit, shouldApplyLocalSearch, sortPopulation, starveByFitness, starveRandomly, starveToLimit, toString, updateBestIndividualFromArchive, updateFitnessFunctionsAndValues, updateProbability, updateSecondaryCriterion, writeIndividualsprotected TestSuiteFitnessFunction suiteFitness
protected SelectionFunction<T extends Chromosome> selectionFunction
protected Ranking<T extends Chromosome> ranking
public AbstractMOSA(ChromosomeFactory<T> factory)
factory - a ChromosomeFactory objectprotected List<T> breedNextGeneration()
public void clearCachedResults(T chromosome)
chromosome - TestChromosome to cleanpublic boolean removeUnusedVariables(T chromosome)
chromosome - protected void notifyEvaluation(Chromosome chromosome)
notifyEvaluation in class GeneticAlgorithm<T extends Chromosome>chromosome - a Chromosome object.protected void calculateFitness()
public List<T> getBestIndividuals()
GeneticAlgorithmgetBestIndividuals in class GeneticAlgorithm<T extends Chromosome>Chromosome object(s).protected abstract void calculateFitness(T c)
c - chromosomeprotected List<T> getNonDominatedSolutions(List<T> solutions)
solutionSet - set of test cases to analyze with the "dominance" relationshipprotected boolean areEqual(T test1, T test2)
breedNextGeneration().test1 - first testtest2 - second testpublic void initializePopulation()
initializePopulation in class GeneticAlgorithm<T extends Chromosome>protected abstract double numberOfCoveredTargets()
public abstract Set<FitnessFunction<T>> getCoveredGoals()
Copyright © 2010–2017 EvoSuite. All rights reserved.