Class __RNAME__BaseMove

java.lang.Object
es.urjc.etsii.grafo.solution.Move<__RNAME__Solution,__RNAME__Instance>
es.urjc.etsii.grafo.__RNAME__.model.__RNAME__BaseMove
Direct Known Subclasses:
__RNAME__ListManager.__RNAME__GRASPMove

public abstract class __RNAME__BaseMove extends Move<__RNAME__Solution,__RNAME__Instance>
Example movement class. Can be an insert, a swap, anything that modifies the solution state
  • Constructor Details

    • __RNAME__BaseMove

      public __RNAME__BaseMove(__RNAME__Solution solution)
      Move constructor
      Parameters:
      solution - solution
  • Method Details

    • _execute

      protected abstract __RNAME__Solution _execute(__RNAME__Solution solution)
      Executes the proposed move, to be implemented by each move type. It is up to the implementation to decide if the original solution is modified in place or a new one is created by cloning the original solution and then applying the changes.

      This method should be idempotent, i.e. calling it multiple times with the same solution should return the same result
      Specified by:
      _execute in class Move<__RNAME__Solution,__RNAME__Instance>
      Parameters:
      solution - Solution where this move will be applied to.
      Returns:
      modified solution
    • getScoreChange

      public abstract double getScoreChange()
      Get the movement value, represents how much does the move changes the f.o of a solution if executed
      Returns:
      f.o change
    • toString

      public abstract String toString()
      Returns a String representation of the current movement. Only use relevant fields. Tip: Default IntelliJ implementation is fine
      Specified by:
      toString in class Move<__RNAME__Solution,__RNAME__Instance>
      Returns:
      human readable string
    • equals

      public abstract boolean equals(Object o)
      Specified by:
      equals in class Move<__RNAME__Solution,__RNAME__Instance>
    • hashCode

      public abstract int hashCode()
      Specified by:
      hashCode in class Move<__RNAME__Solution,__RNAME__Instance>