Class TSPTWBaseMove
java.lang.Object
es.urjc.etsii.grafo.solution.Move<TSPTWSolution, TSPTWInstance>
es.urjc.etsii.grafo.tsptw.model.TSPTWBaseMove
- Direct Known Subclasses:
TSPTWListManager.TSPTWGRASPMove
Example movement class. Can be an insert, a swap, anything that modifies the solution state
-
Field Summary
Fields inherited from class Move
solutionVersion -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract TSPTWSolution_execute(TSPTWSolution 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
-
TSPTWBaseMove
-
-
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<TSPTWSolution, TSPTWInstance>- 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<TSPTWSolution, TSPTWInstance>- Returns:
- human readable string
-
equals
- Specified by:
equalsin classMove<TSPTWSolution, TSPTWInstance>
-
hashCode
public abstract int hashCode()- Specified by:
hashCodein classMove<TSPTWSolution, TSPTWInstance>
-