net.sf.cpsolver.ifs.heuristics
Class GeneralValueSelection

java.lang.Object
  extended by net.sf.cpsolver.ifs.heuristics.GeneralValueSelection
All Implemented Interfaces:
ValueSelection

public class GeneralValueSelection
extends Object
implements ValueSelection

General implementation of value selection criterion.

Value selection criterion is based on weighted sum of various criteria. It also allows random walk technique and tabu search.
Parameters:

ParameterTypeComment
General.MPPBooleanif true, MPP is being solved
Value.MPPLimitIntegerMPP: limitation of the number of allowed perturbations. If a solution within this limit is gound, it is decreased.
Value.InitialSelectionProbDoubleMPP: probability of selection of the initial value
Value.RandomWalkProbDoubleRandom Walk: probability of selection of a value randomly among all the values
Value.TabuIntegerTabu Search: length of the tabu-list
Value.GoodSelectionProbDoubleIn case of MacPropagation, with this probability (1.0 means always), the selection is made only among good values (not removed from the domain).

Following weights are used in the weighted sum (computed for all values). The value with the lowest weighted sum is selected. If there are more than one of such values, one of them is selected randomly.
ParameterTypeComment
Value.WeightDeltaInitialAssignmentsDoubleMPP: Difference in the number of assigned initial values if the value is assigned to the variable (weighted by this Value.WeightDeltaInitialAssignments): -1 if the value is initial, 0 otherwise, increased by the number of initial values assigned to variables with hard conflicts with the value
Value.WeightWeightedConflictsDoubleWhen ConflictStatistics is used: weighted number of conflicting variables
Value.WeightPotentialConflictsDoubleWhen ConflictStatistics is used: weighted number of potentially conflicting variables
Value.WeightConflictsDoubleNumber of conflicting variables Model.conflictValues(Value).
Value.WeightNrAssignmentsDoubleNumber of previous assignments of the value
Value.WeightValueDoubleValue Value.toDouble()

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:
VariableSelection, Solver

Field Summary
protected  ArrayList iTabu
           
protected  int iTabuPos
           
protected  int iTabuSize
           
 
Constructor Summary
GeneralValueSelection()
           
GeneralValueSelection(DataProperties properties)
          Constructor
 
Method Summary
 void init(Solver solver)
          Initialization
 Value selectValue(Solution solution, Variable selectedVariable)
          Value selecion
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

iTabuSize

protected int iTabuSize

iTabu

protected ArrayList iTabu

iTabuPos

protected int iTabuPos
Constructor Detail

GeneralValueSelection

public GeneralValueSelection()

GeneralValueSelection

public GeneralValueSelection(DataProperties properties)
Constructor

Parameters:
properties - input configuration
Method Detail

init

public void init(Solver solver)
Initialization

Specified by:
init in interface ValueSelection

selectValue

public Value selectValue(Solution solution,
                         Variable selectedVariable)
Value selecion

Specified by:
selectValue in interface ValueSelection
Parameters:
solution - current solution
selectedVariable - selected variable