public class SingleSwapNeighbourhood extends Object implements Neighbourhood<PermutationSolution>
Constructor and Description |
---|
SingleSwapNeighbourhood() |
Modifier and Type | Method and Description |
---|---|
List<SingleSwapMove> |
getAllMoves(PermutationSolution solution)
Create a list of all possible single swap moves.
|
SingleSwapMove |
getRandomMove(PermutationSolution solution,
Random rnd)
Create a random single swap move.
|
String |
toString()
Get string indicating neighbourhood type.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getRandomMove
public SingleSwapMove getRandomMove(PermutationSolution solution, Random rnd)
getRandomMove
in interface 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<SingleSwapMove> getAllMoves(PermutationSolution solution)
getAllMoves
in interface Neighbourhood<PermutationSolution>
solution
- permutation solution to which the move is to be appliedCopyright © 2016. All rights reserved.