net.sf.cpsolver.ifs.heuristics
Class StandardNeighbourSelection

java.lang.Object
  extended by net.sf.cpsolver.ifs.heuristics.StandardNeighbourSelection
All Implemented Interfaces:
NeighbourSelection
Direct Known Subclasses:
BacktrackNeighbourSelection, NeighbourSelectionWithSuggestions, RoundRobinNeighbourSelection

public class StandardNeighbourSelection
extends Object
implements NeighbourSelection

Standard neighbour selection criterion.

This criterion is using the provided variable and value selection criteria. In each step, a variable is selected first using the VariableSelection. Then, a value is selected to the selected variable, using the ValueSelection. A SimpleNeighbour containing the selected value is returned.

Note: the use of neighbour select criteria extends the former implementation of the IFS algorithm which was only able to use variable and value selection criteria and therefore only one value was assigned in each iteration.

Parameters:

ParameterTypeComment
Value.ClassStringFully qualified class name of the value selection criterion (see ValueSelection, e.g. GeneralValueSelection)
Variable.ClassStringFully qualified class name of the variable selection criterion (see VariableSelection, e.g. GeneralVariableSelection)

Version:
IFS 1.1 (Iterative Forward Search)
Copyright (C) 2006 Tomáš Müller
muller@unitime.org
Lazenska 391, 76314 Zlin, Czech Republic

This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
See Also:
Solver

Field Summary
protected static Logger sLogger
           
 
Constructor Summary
StandardNeighbourSelection(DataProperties properties)
          Constructor
 
Method Summary
 ValueSelection getValueSelection()
          Returns values selection criterion
 VariableSelection getVariableSelection()
          Returns variable selection criterion
 void init(Solver solver)
          Initialization -- methods VariableSelection.init(Solver) and ValueSelection.init(Solver) are called.
 Neighbour selectNeighbour(Solution solution)
          Select neighbour.
 Value selectValue(Solution solution, Variable variable)
          Use the provided value selection criterion to select a value to the selected variable
 Variable selectVariable(Solution solution)
          Use the provided variable selection criterion to select a variable
 void setValueSelection(ValueSelection valueSelection)
          Sets value selection criterion
 void setVariableSelection(VariableSelection variableSelection)
          Sets variable selection criterion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sLogger

protected static Logger sLogger
Constructor Detail

StandardNeighbourSelection

public StandardNeighbourSelection(DataProperties properties)
                           throws Exception
Constructor

Parameters:
properties - configuration
Throws:
Exception
Method Detail

setValueSelection

public void setValueSelection(ValueSelection valueSelection)
Sets value selection criterion


setVariableSelection

public void setVariableSelection(VariableSelection variableSelection)
Sets variable selection criterion


getValueSelection

public ValueSelection getValueSelection()
Returns values selection criterion


getVariableSelection

public VariableSelection getVariableSelection()
Returns variable selection criterion


init

public void init(Solver solver)
Initialization -- methods VariableSelection.init(Solver) and ValueSelection.init(Solver) are called.

Specified by:
init in interface NeighbourSelection

selectVariable

public Variable selectVariable(Solution solution)
Use the provided variable selection criterion to select a variable


selectValue

public Value selectValue(Solution solution,
                         Variable variable)
Use the provided value selection criterion to select a value to the selected variable


selectNeighbour

public Neighbour selectNeighbour(Solution solution)
Select neighbour. A value is selected to the selected variable.

Specified by:
selectNeighbour in interface NeighbourSelection
Parameters:
solution - given solution
Returns:
a neighbour assignment