Package org.uma.jmetal.util
Class SolutionListUtils
java.lang.Object
org.uma.jmetal.util.SolutionListUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondistanceBasedSubsetSelection(List<S> originalSolutionList, int finalListSize) Method implements a version of the distance-based subset selection algorithm described in: H.static <S extends Solution<?>>
double[][]distanceMatrix(List<S> solutionSet) Returns a matrix with the euclidean distance between each pair of solutions in the population.static <S> voidfillPopulationWithNewSolutions(List<S> solutionList, Problem<S> problem, int maxListSize) Fills a population with new solutions until its size is maxListSizestatic <S> SfindBestSolution(List<S> solutionList, Comparator<S> comparator) static <S> intfindIndexOfBestSolution(List<S> solutionList, Comparator<S> comparator) Finds the index of the best solution in the list according to a comparatorstatic <S> intfindIndexOfWorstSolution(List<? extends S> solutionList, Comparator<S> comparator) Finds the index of the worst solution in the list according to a comparator<S> SfindWorstSolution(Collection<S> solutionList, Comparator<S> comparator) getInvertedFront(List<S> solutionSet) This method receives a normalized list of non-dominated solutions and return the inverted one.static <S extends Solution<?>>
double[][]getMatrixWithObjectiveValues(List<S> solutionList) Given a list of solutions, returns a matrix with the objective values of all the solutionsgetNonDominatedSolutions(List<S> solutionList) static <S extends Solution<?>>
double[]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 liststatic <S extends Solution<?>>
booleanisSolutionDominatedBySolutionList(S solution, List<? extends S> solutionSet) static <S extends Solution<?>>
double[][]normalizedDistanceMatrix(List<S> solutionSet, double[] maxs, double[] mins) normalizeSolutionList(List<S> solutions) This method receives a list of non-dominated solutions and maximum and minimum values of the objectives, and returns a normalized set of solutions.normalizeSolutionList(List<S> 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> voidremoveSolutionsFromList(List<S> solutionList, int numberOfSolutionsToRemove) Removes a number of solutions from a liststatic <S> voidThis method takes a list of solutions, removes a percentage of its solutions, and it is filled with new random generated solutionsstatic <S extends Solution<?>>
double[][]writeObjectivesToMatrix(List<S> solutionList)
-
Constructor Details
-
SolutionListUtils
public SolutionListUtils()
-
-
Method Details
-
getNonDominatedSolutions
-
findWorstSolution
-
findIndexOfBestSolution
Finds the index of the best solution in the list according to a comparator- Parameters:
solutionList-comparator-- Returns:
- The index of the best solution
-
findIndexOfWorstSolution
public 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- Parameters:
solutionList-comparator-- Returns:
- The index of the best solution
-
findBestSolution
-
writeObjectivesToMatrix
-
normalizeSolutionList
public static <S extends Solution<?>> List<S> normalizeSolutionList(List<S> 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.- Parameters:
solutions- A list of non-dominated solutionsminValues- The minimum values of the objectivesmaxValues- The maximum values of the objectives- Returns:
- the normalized list of non-dominated solutions
-
normalizeSolutionList
This method receives a list of non-dominated solutions and maximum and minimum values of the objectives, and returns a normalized set of solutions.- Parameters:
solutions- A list of non-dominated solutions- Returns:
- the normalized list of non-dominated solutions
-
getInvertedFront
This method receives a normalized list of non-dominated solutions and return the inverted one. This operation is needed for minimization problem- Parameters:
solutionSet- The front to invert- Returns:
- The inverted front
-
isSolutionDominatedBySolutionList
-
distanceMatrix
-
normalizedDistanceMatrix
-
restart
public static <S> void restart(List<S> solutionList, Problem<S> problem, int percentageOfSolutionsToRemove) This method takes a list of solutions, removes a percentage of its solutions, and it is filled with new random generated solutions- Parameters:
solutionList-problem-percentageOfSolutionsToRemove-
-
removeSolutionsFromList
Removes a number of solutions from a list- Parameters:
solutionList- The list of solutionsnumberOfSolutionsToRemove-
-
fillPopulationWithNewSolutions
public static <S> void fillPopulationWithNewSolutions(List<S> solutionList, Problem<S> problem, int maxListSize) Fills a population with new solutions until its size is maxListSize- Type Parameters:
S- The type of the solutions to be created- Parameters:
solutionList- The list of solutionsproblem- The problem being solvedmaxListSize- The target size of the list
-
getObjectiveArrayFromSolutionList
public static <S extends Solution<?>> double[] 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- Type Parameters:
S-- Parameters:
solutionList-objective-- Returns:
-
distanceBasedSubsetSelection
public static <S extends Solution<?>> List<S> distanceBasedSubsetSelection(List<S> originalSolutionList, int finalListSize) Method implements a version of the distance-based subset selection algorithm described in: H. K. Singh, K. S. Bhattacharjee, and T. Ray, ‘Distance-based subset selection for benchmarking in evolutionary multi/many-objective optimization,’ IEEE Trans. on Evolutionary Computation, 23(5), 904-912, (2019). DOI: https://doi.org/10.1109/TEVC.2018.2883094- Type Parameters:
S-- Parameters:
originalSolutionList-finalListSize- The size of the result list- Returns:
-
getMatrixWithObjectiveValues
-