net.sf.cpsolver.ifs.heuristics
Class StandardNeighbourSelection<V extends Variable<V,T>,T extends Value<V,T>>

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

public class StandardNeighbourSelection<V extends Variable<V,T>,T extends Value<V,T>>
extends Object
implements NeighbourSelection<V,T>

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:

Parameter Type Comment
Value.Class String Fully qualified class name of the value selection criterion (see ValueSelection, e.g. GeneralValueSelection)
Variable.Class String Fully qualified class name of the variable selection criterion (see VariableSelection, e.g. GeneralVariableSelection)

Version:
IFS 1.2 (Iterative Forward Search)
Copyright (C) 2006 - 2010 Tomas Muller
muller@unitime.org
http://muller.unitime.org

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 3 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 see .
See Also:
Solver

Field Summary
protected static org.apache.log4j.Logger sLogger
           
 
Constructor Summary
StandardNeighbourSelection(DataProperties properties)
          Constructor
 
Method Summary
 ValueSelection<V,T> getValueSelection()
          Returns values selection criterion
 VariableSelection<V,T> getVariableSelection()
          Returns variable selection criterion
 void init(Solver<V,T> solver)
          Initialization -- methods VariableSelection.init(Solver) and ValueSelection.init(Solver) are called.
 Neighbour<V,T> selectNeighbour(Solution<V,T> solution)
          Select neighbour.
 T selectValue(Solution<V,T> solution, V variable)
          Use the provided value selection criterion to select a value to the selected variable
 V selectVariable(Solution<V,T> solution)
          Use the provided variable selection criterion to select a variable
 void setValueSelection(ValueSelection<V,T> valueSelection)
          Sets value selection criterion
 void setVariableSelection(VariableSelection<V,T> 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 org.apache.log4j.Logger sLogger
Constructor Detail

StandardNeighbourSelection

public StandardNeighbourSelection(DataProperties properties)
                           throws Exception
Constructor

Parameters:
properties - configuration
Throws:
Exception
Method Detail

setValueSelection

public void setValueSelection(ValueSelection<V,T> valueSelection)
Sets value selection criterion


setVariableSelection

public void setVariableSelection(VariableSelection<V,T> variableSelection)
Sets variable selection criterion


getValueSelection

public ValueSelection<V,T> getValueSelection()
Returns values selection criterion


getVariableSelection

public VariableSelection<V,T> getVariableSelection()
Returns variable selection criterion


init

public void init(Solver<V,T> solver)
Initialization -- methods VariableSelection.init(Solver) and ValueSelection.init(Solver) are called.

Specified by:
init in interface NeighbourSelection<V extends Variable<V,T>,T extends Value<V,T>>

selectVariable

public V selectVariable(Solution<V,T> solution)
Use the provided variable selection criterion to select a variable


selectValue

public T selectValue(Solution<V,T> solution,
                     V variable)
Use the provided value selection criterion to select a value to the selected variable


selectNeighbour

public Neighbour<V,T> selectNeighbour(Solution<V,T> solution)
Select neighbour. A value is selected to the selected variable.

Specified by:
selectNeighbour in interface NeighbourSelection<V extends Variable<V,T>,T extends Value<V,T>>
Parameters:
solution - given solution
Returns:
a neighbour assignment


Copyright © 2014 UniTime LLC. All Rights Reserved.