Class CAPBaseMove
java.lang.Object
es.urjc.etsii.grafo.solution.Move<CAPSolution,CAPInstance>
es.urjc.etsii.grafo.flayouts.model.CAPBaseMove
Base class for all movements for the CAP problem. All movements should extend this class.
-
Field Summary
Fields inherited from class es.urjc.etsii.grafo.solution.Move
solutionVersion
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract CAPSolution
_execute
(CAPSolution solution) Executes the proposed move, to be implemented by each move type.abstract boolean
abstract double
getValue()
Get the movement value, represents how much does the move changes the f.o of a solution if executedabstract int
hashCode()
abstract String
toString()
Returns a String representation of the current movement.
-
Constructor Details
-
CAPBaseMove
Move constructor- Parameters:
solution
- solution
-
-
Method Details
-
_execute
Executes the proposed move, to be implemented by each move type.- Specified by:
_execute
in classMove<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
Returns a String representation of the current movement. Only use relevant fields. Tip: Default IntelliJ implementation is fine- Specified by:
toString
in classMove<CAPSolution,
CAPInstance> - Returns:
- human readable string
-
equals
- Specified by:
equals
in classMove<CAPSolution,
CAPInstance>
-
hashCode
public abstract int hashCode()- Specified by:
hashCode
in classMove<CAPSolution,
CAPInstance>
-