java.lang.Object
es.urjc.etsii.grafo.algorithms.Algorithm<S,I>
es.urjc.etsii.grafo.algorithms.scattersearch.ScatterSearch<S,I>
-
Constructor Summary
ConstructorsConstructorDescriptionScatterSearch
(String name, double initialRatio, int refsetSize, Constructive<S, I> constructiveGoodValues, Constructive<S, I> constructiveGoodDiversity, Improver<S, I> improver, SolutionCombinator<S, I> combinator, Objective<?, S, I> objective, int maxIterations, double diversityRatio, SolutionDistance<S, I> solutionDistance, boolean softRestartEnabled) -
Method Summary
Modifier and TypeMethodDescriptionRuns the algorithmprotected void
protected void
forceFill
(I instance, Set<S> alreadyUsed, S[] initialRefsetArray, int offset, int assignedSolutions, int nRequiredSolutions, int nInitialSolutions) initializeRefset
(Class<?> clazz, I instance) protected S
initializeSolution
(I instance, boolean diverse) initializeSolutions
(I instance, int size, boolean diverse) protected double
minDistanceToSolList
(S referenceSolution, S[] initialDiverseSolutions) protected void
replaceWorstNearest
(RefSet<S, I> refset, S solution) Try to insert the given solution in the refset.toString()
Methods inherited from class es.urjc.etsii.grafo.algorithms.Algorithm
getBuilder, getName, newSolution, setBuilder, setName
-
Constructor Details
-
ScatterSearch
@AutoconfigConstructor public ScatterSearch(@ProvidedParam String name, @RealParam(min=1.0,max=10.0) double initialRatio, @IntegerParam(min=10,max=30) int refsetSize, Constructive<S, I> constructiveGoodValues, Constructive<S, I> constructiveGoodDiversity, Improver<S, I> improver, SolutionCombinator<S, I> combinator, @ProvidedParam Objective<?, S, I> objective, @IntegerParam(min=1) int maxIterations, @RealParam(min=0.0,max=1.0) double diversityRatio, SolutionDistance<S, I> solutionDistance, @CategoricalParam(strings={"true","false"}) boolean softRestartEnabled) - Parameters:
initialRatio
- During refset initialization, create initialRefset size * INITIAL_RATIO solutions, to ensure we have enough non repeated and diverse solutionsrefsetSize
- Number of solutions to keep in refsetconstructiveGoodValues
- Method used to generate the initial refsetconstructiveGoodDiversity
- Method used to generate diverse solutionsimprover
- Method to improve any given solution, such as a local searchcombinator
- Creates a solution as a combination of two different solutionsdiversityRatio
- Porcentage of diverse solution to use relaive to the refset size. 0 means use only best value criteria, 1 use only diversity criteria, 0.5 half the refset uses diversity criteria, the other half best value criteria.solutionDistance
- How to calculate distance between a given set of solutions. SeeSolutionDistance
for more details.
-
-
Method Details
-
initializeRefset
-
forceFill
-
softRestart
-
replaceWorstNearest
Try to insert the given solution in the refset. If the solution is better than all in refset it is always inserted. if it is better than some, replace the nearest solution to given solution, and keep refset sorted If the solution is worse than all in refset, the refset remains unchanged- Parameters:
refset
- Reference Setsolution
- Solution to try to insert in refset
-
algorithm
Description copied from class:Algorithm
Runs the algorithm -
debugStatus
-
minDistanceToSolList
-
initializeSolutions
-
initializeSolution
-
mergeToSetByScore
-
toString
-