Class Constructive<S extends Solution<S,I>,I extends Instance>

java.lang.Object
es.urjc.etsii.grafo.create.Constructive<S,I>
Type Parameters:
S - Solution class
I - Instance class
Direct Known Subclasses:
__RNAME__RandomConstructive, Constructive.NullConstructive, FasterInvertedConstructive, RandomConstructive, Reconstructive, SlowConstructive, TSPRandomConstructive

public abstract class Constructive<S extends Solution<S,I>,I extends Instance> extends Object
Builds a new solution for the current problem. There are multiple strategies to create the solution: Using greedy strategies, GRASP, random, etc.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    No operation constructive method Returns the solution immediately without executing any operation Not included by default as an autoconfig component because most problems require a constructive method or solutions will not be valid
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract S
    construct(S solution)
    Build a solution.
    static <S extends Solution<S, I>, I extends Instance>
    Constructive<S,I>
    nul()
    Create a no operation constructive method Returns the solution immediately without executing any operation

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Constructive

      public Constructive()
  • Method Details

    • construct

      public abstract S construct(S solution)
      Build a solution. Start with an empty solution, end when the solution is valid.
      Parameters:
      solution - Empty solution, the result of calling the constructor.
      Returns:
      A valid solution that fulfills all the problem constraints.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • nul

      public static <S extends Solution<S, I>, I extends Instance> Constructive<S,I> nul()
      Create a no operation constructive method Returns the solution immediately without executing any operation
      Type Parameters:
      S - Solution class
      I - Instance class
      Returns:
      Null constructive method