public class SolutionListUtils extends Object
| Constructor and Description |
|---|
SolutionListUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <S extends Solution<?>> |
distanceMatrix_normalize(List<S> solutionSet,
double[] maxs,
double[] mins) |
static <S extends Solution<?>> |
distanceMatrix(List<S> solutionSet)
Returns a matrix with the euclidean distance between each pair of solutions in the population.
|
static <S> void |
fillPopulationWithNewSolutions(List<S> solutionList,
Problem<S> problem,
int maxListSize)
Fills a population with new solutions until its size is maxListSize
|
static <S> S |
findBestSolution(List<S> solutionList,
Comparator<S> comparator) |
static <S> int |
findIndexOfBestSolution(List<S> solutionList,
Comparator<S> comparator)
Finds the index of the best solution in the list according to a comparator
|
static <S> int |
findIndexOfWorstSolution(List<? extends S> solutionList,
Comparator<S> comparator)
Finds the index of the worst solution in the list according to a comparator
|
<S> S |
findWorstSolution(Collection<S> solutionList,
Comparator<S> comparator) |
static <S extends Solution<?>> |
getInvertedFront(List<S> solutionSet)
This method receives a normalized list of non-dominated solutions and return the inverted one.
|
static <S extends Solution<?>> |
getNondominatedSolutions(List<S> solutionList) |
static <S extends Solution<?>> |
getObjectiveArrayFromSolutionList(List<S> solutionList,
int objective)
Given a solution list and the identifier of an objective (0, 1, etc), returns an array with
the values of that objective in all the solutions of the list
|
static <S extends Solution<?>> |
isSolutionDominatedBySolutionList(S solution,
List<? extends S> solutionSet) |
static List<? extends Solution<?>> |
normalize(List<? extends Solution<?>> solutions,
double[] minValues,
double[] maxValues)
This method receives a list of non-dominated solutions and maximum and
minimum values of the objectives, and returns a normalized set of
solutions.
|
static <S> void |
removeSolutionsFromList(List<S> solutionList,
int numberOfSolutionsToRemove)
Removes a number of solutions from a list
|
static <S> void |
restart(List<S> solutionList,
Problem<S> problem,
int percentageOfSolutionsToRemove)
This methods takes a list of solutions, removes a percentage of its solutions, and it is filled
with new random generated solutions
|
static <S> List<S> |
selectNRandomDifferentSolutions(int numberOfSolutionsToBeReturned,
List<S> solutionList)
This method receives a normalized list of non-dominated solutions and return the inverted one.
|
static <S> List<S> |
selectNRandomDifferentSolutions(int numberOfSolutionsToBeReturned,
List<S> solutionList,
BoundedRandomGenerator<Integer> randomGenerator)
This method receives a normalized list of non-dominated solutions and return the inverted one.
|
static <S> boolean |
solutionListsAreEquals(List<S> solutionList,
List<S> newSolutionList)
Compares two solution lists to determine if both are equals
|
static <S extends Solution<?>> |
writeObjectivesToMatrix(List<S> solutionList) |
public static <S extends Solution<?>> List<S> getNondominatedSolutions(List<S> solutionList)
public <S> S findWorstSolution(Collection<S> solutionList, Comparator<S> comparator)
public static <S> int findIndexOfBestSolution(List<S> solutionList, Comparator<S> comparator)
solutionList - comparator - public static <S> int findIndexOfWorstSolution(List<? extends S> solutionList, Comparator<S> comparator)
solutionList - comparator - public static <S> S findBestSolution(List<S> solutionList, Comparator<S> comparator)
public static <S extends Solution<?>> double[][] writeObjectivesToMatrix(List<S> solutionList)
public static List<? extends Solution<?>> normalize(List<? extends Solution<?>> solutions, double[] minValues, double[] maxValues)
solutions - A list of non-dominated solutionsmaxValues - The maximum values of the objectivesminValues - The minimum values of the objectivespublic static <S extends Solution<?>> List<S> getInvertedFront(List<S> solutionSet)
solutionSet - The front to invertpublic static <S extends Solution<?>> boolean isSolutionDominatedBySolutionList(S solution, List<? extends S> solutionSet)
public static <S> List<S> selectNRandomDifferentSolutions(int numberOfSolutionsToBeReturned, List<S> solutionList)
solutionList - The front to invertpublic static <S> List<S> selectNRandomDifferentSolutions(int numberOfSolutionsToBeReturned, List<S> solutionList, BoundedRandomGenerator<Integer> randomGenerator)
solutionList - The front to invertrandomGenerator - The random generator to usepublic static <S extends Solution<?>> double[][] distanceMatrix(List<S> solutionSet)
solutionSet - public static <S extends Solution<?>> double[][] distanceMatrix_normalize(List<S> solutionSet, double[] maxs, double[] mins)
public static <S> boolean solutionListsAreEquals(List<S> solutionList, List<S> newSolutionList)
solutionList - A Solution listnewSolutionList - A Solution listpublic static <S> void restart(List<S> solutionList, Problem<S> problem, int percentageOfSolutionsToRemove)
solutionList - problem - percentageOfSolutionsToRemove - public static <S> void removeSolutionsFromList(List<S> solutionList, int numberOfSolutionsToRemove)
solutionList - The list of solutionsnumberOfSolutionsToRemove - public static <S> void fillPopulationWithNewSolutions(List<S> solutionList, Problem<S> problem, int maxListSize)
S - The type of the solutions to be createdsolutionList - The list of solutionsproblem - The problem being solvedmaxListSize - The target size of the listpublic static <S extends Solution<?>> double[] getObjectiveArrayFromSolutionList(List<S> solutionList, int objective)
S - solutionList - objective - Copyright © 2019. All rights reserved.