Package es.urjc.etsii.grafo.create.grasp
Class GRASPListManager<M extends Move<S,I>,S extends Solution<S,I>,I extends Instance>
java.lang.Object
es.urjc.etsii.grafo.create.grasp.GRASPListManager<M,S,I>
- Direct Known Subclasses:
__RNAME__ListManager
,GRASPListManager.NullGraspListManager
,TSPListManager
public abstract class GRASPListManager<M extends Move<S,I>,S extends Solution<S,I>,I extends Instance>
extends Object
Creates and updates the candidate list when a movement is performed
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
afterGRASP
(S solution) Do any kind of post-processing after there are no more valid GRASP movesvoid
beforeGRASP
(S solution) Initialize solution before GRASP algorithm is run F.e: In the case of clustering algorithms, usually each cluster needs to have at least one point, different solutions types may require different initializationbuildInitialCandidateList
(S solution) Generate initial candidate list.static <M extends Move<S,
I>, S extends Solution<S, I>, I extends Instance>
GRASPListManager<M, S, I> nul()
Create a no operation GRASPListManager method Returns empty liststoString()
Return string representation of the current list manager.updateCandidateList
(S solution, M move, List<M> candidateList, int index) Update candidate list after each movement.
-
Constructor Details
-
GRASPListManager
public GRASPListManager()
-
-
Method Details
-
beforeGRASP
Initialize solution before GRASP algorithm is run F.e: In the case of clustering algorithms, usually each cluster needs to have at least one point, different solutions types may require different initialization- Parameters:
solution
- Solution to initialize before running the GRASP constructive method
-
afterGRASP
Do any kind of post-processing after there are no more valid GRASP moves- Parameters:
solution
- Solution to modify after the GRASP constructive method has finished
-
buildInitialCandidateList
Generate initial candidate list.- Parameters:
solution
- Current solution- Returns:
- an UNSORTED candidate list
-
updateCandidateList
Update candidate list after each movement. The list will be sorted by the constructor.- Parameters:
solution
- Current solution, move has been already appliedmove
- Chosen movecandidateList
- original candidate listindex
- index of the chosen move in the candidate list- Returns:
- an UNSORTED candidate list, where the best candidate is on the first position and the worst in the last
-
toString
Return string representation of the current list manager. Defaults to "classname{}", override if custom parameters should appear in the string. -
nul
public static <M extends Move<S,I>, GRASPListManager<M,S extends Solution<S, I>, I extends Instance> S, nul()I> Create a no operation GRASPListManager method Returns empty lists- Type Parameters:
M
- Move classS
- Solution classI
- Instance class- Returns:
- Null GRASPListManager method
-