java.lang.Object
es.urjc.etsii.grafo.algorithms.Algorithm<S,I>
- Type Parameters:
S- Solution classI- Instance class
- Direct Known Subclasses:
EmptyAlgorithm, FloydWharshallAlg, GVNS, IteratedGreedy, KruskalAlg, MultiStartAlgorithm, MultistartOnlyBestAppliesLS, NDijkstraAlg, PrimAlg, ScatterSearch, SeqExchangerILS, SimpleAlgorithm, TestAlgorithm, VNS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract SRuns the algorithmprotected SolutionBuilder<S, I> Get solution buildergetName()Algorithm name, uniquely identifies the algorithm inside an experimentnewSolution(I instance) Create a new solution for the given instance.voidsetBuilder(SolutionBuilder<S, I> builder) Set solution builder, used by the framework.voidSets the algorithm name.toString()
-
Constructor Details
-
Algorithm
Initialize common algorithm fields- Parameters:
algorithmName- algorithm name. SeesetName(String)
-
-
Method Details
-
getName
Algorithm name, uniquely identifies the algorithm inside an experiment- Returns:
- algorithm name
-
setName
Sets the algorithm name. This method can be called after the algorithm has been built, for example if we want to customize the name generated by the autoconfig module. This method CANNOT be called after the algorithm has started executing, as it would break the experiment results. The algorithm name is used to uniquely identify the algorithm inside an experiment.- Parameters:
algorithmName- must uniquely identify the algorithm inside an experiment
-
algorithm
-
newSolution
-
getBuilder
-
setBuilder
Set solution builder, used by the framework. In case an algorithms contains another algorithms, this method should be overridden as follows:@Override public void setBuilder(SolutionBuilder<S, I> builder) { super.setBuilder(builder); this.algorithm.setBuilder(builder); }- Parameters:
builder- solution builder
-
toString
-