choco.cp.solver.search.integer.varselector.ratioselector
Class AbstractIntVarRatioSelector
java.lang.Object
choco.kernel.solver.search.AbstractSearchHeuristic
choco.cp.solver.search.integer.varselector.ratioselector.AbstractIntVarRatioSelector
- All Implemented Interfaces:
- IntVarRatioSelector, VarSelector<IntDomainVar>, TiedIntVarSelector
- Direct Known Subclasses:
- MaxRatioSelector, MinRatioSelector, RandMaxRatioSelector, RandMinRatioSelector
public abstract class AbstractIntVarRatioSelector
- extends AbstractSearchHeuristic
- implements IntVarRatioSelector
A class that select the min/max ratio (a/b) among an arrays.
the for-loop of search stores the index of the first not instantiated variable.
Two ratios are compared by the formula a1 * b2 <=/>= a2 * b1 (note cast to long avoids integer overflow
)
- Since:
- 26 mars 2010 version 2.1.1
- Version:
- 2.1.1
- Author:
- Arnaud Malapert
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ratios
protected final IntRatio[] ratios
AbstractIntVarRatioSelector
public AbstractIntVarRatioSelector(Solver solver,
IntRatio[] ratios)
getRatios
public final IntRatio[] getRatios()
- Specified by:
getRatios
in interface IntVarRatioSelector
isUp
protected abstract boolean isUp(long leftM,
long rightM)
selectRandIntRatioIndex
protected final int selectRandIntRatioIndex(Random randomBreakTies,
gnu.trove.TIntArrayList canWriteList)
selectIntRatioIndex
public int selectIntRatioIndex()
- Specified by:
selectIntRatioIndex
in interface IntVarRatioSelector
selectIntRatio
public final IntRatio selectIntRatio()
- Specified by:
selectIntRatio
in interface IntVarRatioSelector
selectVar
public final IntDomainVar selectVar()
- Description copied from interface:
VarSelector
- the VarSelector can be asked to return a variable
- Specified by:
selectVar
in interface VarSelector<IntDomainVar>
- Returns:
- a variable on whose domain an alternative can be set (such as a non instantiated search variable)
selectTiedIntVars
public final List<IntDomainVar> selectTiedIntVars()
- Specified by:
selectTiedIntVars
in interface TiedIntVarSelector
Copyright © 2012. All Rights Reserved.