Class RandomConstructive<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.RandomConstructive<M,S,I>
Type Parameters:
S - Solution type
I - Instance type

public class RandomConstructive<M extends Move<S,I>,S extends Solution<S,I>,I extends Instance> extends Constructive<S,I>
Executes random movements from the given neighborhood until there are no moves left to execute
  • Constructor Details

    • RandomConstructive

      public RandomConstructive(RandomizableNeighborhood<M,S,I> neighborhood)
      Create a random constructive that will build solution by choosing random movements from the given neighborhood
      Parameters:
      neighborhood - neighborhood to use during construction
  • Method Details

    • construct

      public S construct(S solution)
      Build a solution. Start with an empty solution, end when the solution is valid.
      Specified by:
      construct in class Constructive<S extends Solution<S,I>,I extends Instance>
      Parameters:
      solution - Empty solution, the result of calling the constructor.
      Returns:
      A valid solution that fulfills all the problem constraints.