Package es.urjc.etsii.grafo.create.grasp
Class GRASPConstructive<M extends Move<S,I>,S extends Solution<S,I>,I extends Instance>
java.lang.Object
es.urjc.etsii.grafo.create.Constructive<S,I>
es.urjc.etsii.grafo.create.Reconstructive<S,I>
es.urjc.etsii.grafo.create.grasp.GRASPConstructive<M,S,I>
- Direct Known Subclasses:
GreedyRandomGRASPConstructive
,RandomGreedyGRASPConstructive
public abstract class GRASPConstructive<M extends Move<S,I>,S extends Solution<S,I>,I extends Instance>
extends Reconstructive<S,I>
-
Nested Class Summary
Nested classes/interfaces inherited from class es.urjc.etsii.grafo.create.Constructive
Constructive.NullConstructive<S extends Solution<S,
I>, I extends Instance> -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AlphaProvider
protected final String
protected final GRASPListManager
<M, S, I> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
GRASPConstructive
(Objective<M, S, I> objective, GRASPListManager<M, S, I> candidateListManager, AlphaProvider provider, String alphaType) -
Method Summary
Modifier and TypeMethodDescriptionassignMissing
(S solution) Assign missing elements to solution.Build a solution.protected abstract int
getCandidateIndex
(double alpha, List<M> cl) Get candidate using any strategyreconstruct
(S solution) Rebuild a partially assigned / partially destroyed solutionMethods inherited from class es.urjc.etsii.grafo.create.Constructive
nul, toString
-
Field Details
-
alphaType
-
candidateListManager
-
alphaProvider
-
objective
-
-
Constructor Details
-
GRASPConstructive
protected GRASPConstructive(Objective<M, S, I> objective, GRASPListManager<M, S, I> candidateListManager, AlphaProvider provider, String alphaType)
-
-
Method Details
-
construct
Build a solution. Start with an empty solution, end when the solution is valid. -
reconstruct
Rebuild a partially assigned / partially destroyed solution- Specified by:
reconstruct
in classReconstructive<S extends Solution<S,
I>, I extends Instance> - Parameters:
solution
- solution partially built- Returns:
- valid solution completely built
-
assignMissing
Assign missing elements to solution. This method ends when the candidate list is empty. The difference between this method and construct is that this method does not call beforeGRASP(). This method can be used in algorithms such as iterated greedy during the reconstruction phase.- Parameters:
solution
- Solution to complete- Returns:
- Completed solution.
-
getCandidateIndex
Get candidate using any strategy- Parameters:
alpha
- alpha valuecl
- candidate list- Returns:
- candidate index
-