V
- VariableT
- Valuepublic 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).
Modifier and Type | Field and Description |
---|---|
protected Solver<V,T> |
iSolver |
protected static Logger |
sLogger |
Constructor and Description |
---|
RoundRobinNeighbourSelection(DataProperties properties)
Constructor
|
Modifier and Type | Method and Description |
---|---|
NeighbourSelection<V,T> |
getSelection() |
int |
getSelectionIndex() |
void |
changeSelection(int selectionIndex)
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
- thrown when initialization failspublic void registerSelection(NeighbourSelection<V,T> selection)
selection
- a neighbour selection to include in the selectionpublic 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 int getSelectionIndex()
public void changeSelection(int selectionIndex)
selectionIndex
- current selection indexpublic NeighbourSelection<V,T> getSelection()