choco.kernel.model.constraints
Class ConstraintManager<V extends Variable>

java.lang.Object
  extended by choco.kernel.model.constraints.ConstraintManager<V>
All Implemented Interfaces:
ExpressionManager
Direct Known Subclasses:
BooleanManager, IntConstraintManager, MixedConstraintManager, RealConstraintManager, SetConstraintManager, TreeManager, UseResourcesManager

public abstract class ConstraintManager<V extends Variable>
extends Object
implements ExpressionManager


Field Summary
 
Fields inherited from interface choco.kernel.model.constraints.ExpressionManager
LOGGER
 
Constructor Summary
ConstraintManager()
           
 
Method Summary
protected static boolean checkParameter(Object[] o, int idx)
           
protected static SConstraint fail()
           
protected static SConstraint fail(String cname)
           
protected static int[] getACFavoriteIntDomains()
           
protected static int[] getBCFavoriteIntDomains()
           
abstract  int[] getFavoriteDomains(List<String> options)
           
abstract  SConstraint makeConstraint(Solver solver, V[] variables, Object parameters, List<String> options)
          Build a constraint for the given solver and "model variables"
abstract  SConstraint[] makeConstraintAndOpposite(Solver solver, V[] variables, Object parameters, List<String> options)
          Build a constraint and its opposite for the given solver and "model variables"
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface choco.kernel.model.constraints.ExpressionManager
makeNode
 

Constructor Detail

ConstraintManager

public ConstraintManager()
Method Detail

makeConstraint

public abstract SConstraint makeConstraint(Solver solver,
                                           V[] variables,
                                           Object parameters,
                                           List<String> options)
Build a constraint for the given solver and "model variables"

Parameters:
solver - solver to build constraint in
variables - array of variables
parameters - Object defining the paramaters
options - set of options
Returns:
One SConstraint

makeConstraintAndOpposite

public abstract SConstraint[] makeConstraintAndOpposite(Solver solver,
                                                        V[] variables,
                                                        Object parameters,
                                                        List<String> options)
Build a constraint and its opposite for the given solver and "model variables"

Parameters:
solver - solver to build constraint in
variables - array of variables
parameters - Object defining the paramaters
options - set of options
Returns:
array of 2 SConstraint object, the constraint and its opposite

getFavoriteDomains

public abstract int[] getFavoriteDomains(List<String> options)
Parameters:
options - : the set of options on the constraint (Typically the level of consistency)
Returns:
a list of domains accepted by the constraint and sorted by order of preference

getACFavoriteIntDomains

protected static int[] getACFavoriteIntDomains()

getBCFavoriteIntDomains

protected static int[] getBCFavoriteIntDomains()

checkParameter

protected static boolean checkParameter(Object[] o,
                                        int idx)

fail

protected static SConstraint fail()

fail

protected static SConstraint fail(String cname)


Copyright © 2012. All Rights Reserved.