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
Example movement class. Can be an insert, a swap, anything that modifies the solution state
-
Field Summary
Fields inherited from class es.urjc.etsii.grafo.solution.Move
solutionVersion
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract __RNAME__Solution
_execute
(__RNAME__Solution solution) Executes the proposed move, to be implemented by each move type.abstract boolean
abstract double
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
-
__RNAME__BaseMove
Move constructor- Parameters:
solution
- solution
-
-
Method Details
-
_execute
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 classMove<__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
Returns a String representation of the current movement. Only use relevant fields. Tip: Default IntelliJ implementation is fine- Specified by:
toString
in classMove<__RNAME__Solution,
__RNAME__Instance> - Returns:
- human readable string
-
equals
- Specified by:
equals
in classMove<__RNAME__Solution,
__RNAME__Instance>
-
hashCode
public abstract int hashCode()- Specified by:
hashCode
in classMove<__RNAME__Solution,
__RNAME__Instance>
-