public class SingleSwapNeighbourhood extends Object implements org.jamesframework.core.search.neigh.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.
|
public SingleSwapMove 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<SingleSwapMove> 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.