Class CAPBaseMove

java.lang.Object
es.urjc.etsii.grafo.solution.Move<CAPSolution,CAPInstance>
es.urjc.etsii.grafo.flayouts.model.CAPBaseMove

public abstract class CAPBaseMove extends Move<CAPSolution,CAPInstance>
Base class for all movements for the CAP problem. All movements should extend this class.
  • Constructor Details

    • CAPBaseMove

      public CAPBaseMove(CAPSolution solution)
      Move constructor
      Parameters:
      solution - solution
  • Method Details

    • _execute

      protected abstract CAPSolution _execute(CAPSolution solution)
      Executes the proposed move, to be implemented by each move type.
      Specified by:
      _execute in class Move<CAPSolution,CAPInstance>
      Parameters:
      solution - Solution where this move will be applied to.
      Returns:
      true if the solution has changed, false if for any reason the movement is not applied or the solution does not change after executing the move
    • getValue

      public abstract double getValue()
      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<CAPSolution,CAPInstance>
      Returns:
      human readable string
    • equals

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

      public abstract int hashCode()
      Specified by:
      hashCode in class Move<CAPSolution,CAPInstance>