public class ReverseSubsequenceNeighbourhood extends Object implements org.jamesframework.core.search.neigh.Neighbourhood<PermutationSolution>
Constructor and Description |
---|
ReverseSubsequenceNeighbourhood() |
Modifier and Type | Method and Description |
---|---|
List<ReverseSubsequenceMove> |
getAllMoves(PermutationSolution solution)
Create a list of all possible moves that reverse a subsequence of the permutation.
|
ReverseSubsequenceMove |
getRandomMove(PermutationSolution solution,
Random rnd)
Create a random move that reverses a subsequence of the permutation.
|
String |
toString()
Get string indicating neighbourhood type.
|
public ReverseSubsequenceMove getRandomMove(PermutationSolution solution, Random rnd)
getRandomMove
in interface org.jamesframework.core.search.neigh.Neighbourhood<PermutationSolution>
solution
- permutation solution to which the move is to be appliedrnd
- source of randomness used to generate random movenull
if the permutation contains less
than 2 itemspublic List<ReverseSubsequenceMove> getAllMoves(PermutationSolution solution)
getAllMoves
in interface org.jamesframework.core.search.neigh.Neighbourhood<PermutationSolution>
solution
- permutation solution to which the move is to be appliedCopyright © 2016. All rights reserved.