java.lang.Object
es.urjc.etsii.grafo.create.Constructive<S,I>
es.urjc.etsii.grafo.algorithms.cmsa.CMSAConstructive<S,I,C>
- Type Parameters:
S- Solution classI- Instance classC- Solution component class
- Direct Known Subclasses:
MVCConstructive
public abstract class CMSAConstructive<S extends Solution<S,I>, I extends Instance, C>
extends Constructive<S,I>
Constructive method used by
CMSA to probabilistically build complete solutions.
Solutions built by this method are only used to sample which solution components (edges, assignments,
items, etc.) look promising: they are never returned as the algorithm result directly.
Besides building a solution as any other Constructive, implementations must be able to identify
which solution components were used to build a given solution, so CMSA can add them to the
restricted sub-instance solved at every iteration, and track their age.
Solution components can be represented using any type that correctly implements equals and
hashCode, for example a record such as record Edge(int from, int to), or an autoboxed
primitive such as Integer when components are simply indexes.
-
Nested Class Summary
Nested classes/interfaces inherited from class Constructive
Constructive.NullConstructive<S,I> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionusedComponents(S solution) Returns the solution components used to build the given solution.Methods inherited from class Constructive
construct, nul, toString
-
Constructor Details
-
CMSAConstructive
public CMSAConstructive()
-
-
Method Details
-
usedComponents
Returns the solution components used to build the given solution. This method is usually called immediately afterConstructive.construct(Solution), but implementations should not assume this and must be able to work with any feasible solution to the problem, as it is also used to identify which components are part of the solution returned by theCMSASolver.- Parameters:
solution- a feasible solution to the problem- Returns:
- the set of solution components used in the given solution
-