public class RoundRobinNeighbourSelection<V extends Variable<V,T>,T extends Value<V,T>> extends StandardNeighbourSelection<V,T>
NeighbourSelection
needs to be registered within the selection. This selection criterion takes
the registered neighbour selections one by one and performs
NeighbourSelection.init(Solver)
and then it is using
NeighbourSelection.selectNeighbour(Solution)
to select a neighbour.
When null is returned by the underlaying selection, next registered neighbour
selection is initialized and used for the following selection(s). If the last
registered selection returns null, the selection is returned to the first
registered neighbour selection (it is initialized before used again).
Constructor and Description |
---|
RoundRobinNeighbourSelection(DataProperties properties)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
changeSelection(Solution<V,T> solution)
Change selection
|
void |
init(Solver<V,T> solver)
Initialization
|
void |
registerSelection(NeighbourSelection<V,T> selection)
Register a neighbour selection
|
Neighbour<V,T> |
selectNeighbour(Solution<V,T> solution)
Select neighbour.
|
getValueSelection, getVariableSelection, selectValue, selectVariable, setValueSelection, setVariableSelection
public RoundRobinNeighbourSelection(DataProperties properties) throws Exception
properties
- configurationException
public void registerSelection(NeighbourSelection<V,T> selection)
public Neighbour<V,T> selectNeighbour(Solution<V,T> solution)
selectNeighbour
in interface NeighbourSelection<V extends Variable<V,T>,T extends Value<V,T>>
selectNeighbour
in class StandardNeighbourSelection<V extends Variable<V,T>,T extends Value<V,T>>
solution
- given solutionpublic void changeSelection(Solution<V,T> solution)