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 booleanabstract doubleGet the movement value, represents how much does the move changes the f.o of a solution if executedabstract inthashCode()abstract StringtoString()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:
_executein 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:
toStringin classMove<__RNAME__Solution,__RNAME__Instance> - Returns:
- human readable string
-
equals
- Specified by:
equalsin classMove<__RNAME__Solution,__RNAME__Instance>
-
hashCode
public abstract int hashCode()- Specified by:
hashCodein classMove<__RNAME__Solution,__RNAME__Instance>
-