choco.kernel.solver.constraints
Interface SConstraint<V extends Var>

All Superinterfaces:
Cloneable, IExtensionnable, IPretty
All Known Subinterfaces:
ISpecializedConstraint
All Known Implementing Classes:
Absolute, AbstractBinIntSConstraint, AbstractBinRealIntSConstraint, AbstractBinSetIntSConstraint, AbstractBinSetSConstraint, AbstractBipartiteFlow, AbstractBipartiteGraph, AbstractBipartiteMatching, AbstractBoolSum, AbstractBoundOfASet, AbstractCumulativeSConstraint, AbstractIntSConstraint, AbstractLargeIntSConstraint, AbstractLargeRealSConstraint, AbstractLargeSetIntSConstraint, AbstractLargeSetSConstraint, AbstractMixedSetIntSConstraint, AbstractMixedSRealIntSConstraint, AbstractPrecedenceSConstraint, AbstractRealSConstraint, AbstractResourceSConstraint, AbstractSConstraint, AbstractSetSConstraint, AbstractSoftCumulative, AbstractStrongConsistency, AbstractTaskSConstraint, AbstractTernIntSConstraint, AbstractTernSetSConstraint, AbstractUnIntSConstraint, AbstractUnRealSConstraint, AbstractUnSetSConstraint, AbstractUseResourcesSConstraint, AC2001BinSConstraint, AC3BinSConstraint, AC3rmBinSConstraint, AC3rmBitBinSConstraint, Adapter, AllDifferent, AllDisjoint, AltCumulative, AltDisjunctive, AmongGAC, AmongSet, AtMostNValue, BinAnd, BinNand, BinNor, BinOr, BinXnor, BinXor, BooleanChanneling, BoolIntLinComb, BoolTimesXYZ, BoundAllDiff, BoundGcc, BoundGccVar, ClauseStore, ComplementSet, ConstantSConstraint, CostKnapSack, CostRegular, CspBinSConstraint, CspLargeSConstraint, Cumulative, Disjoint, Disjunctive, DistanceXYC, DistanceXYZ, DomainChanneling, Element, Element2D, ElementG, ElementV, ElementVG, EqBoolSum, EqualXC, EqualXY_C, EqualXYC, Equation, EuclideanDivisionXYZ, Exactly, ExpressionSConstraint, FastRegular, FCBinSConstraint, ForbiddenIntervals, Formula, GAC2001LargeSConstraint, GAC2001PositiveLargeConstraint, GAC3rmLargeConstraint, GAC3rmPositiveLargeConstraint, GACstrPositiveLargeSConstraint, Geost_Constraint, GeqBoolSum, GlobalCardinality, GlobalCardinalityVar, GreaterOrEqualXC, GreaterOrEqualXY_C, GreaterOrEqualXYC, Identity, IfThenElse, IncreasingNValue, IncreasingSum, IntLinComb, InverseChanneling, InverseChannelingWithinRange, InverseSet, InverseSetInt, IsIncluded, IsNotIncluded, LargeAnd, LargeNand, LargeNor, LargeOr, LargeXnor, LargeXor, LeqBoolSum, LessOrEqualXC, LessOrEqualXY_C, Lex, LexChain, LeximinSConstraint, MaxOfAList, MaxOfASet, MaxRPCrm, MaxXYZ, MemberBound, MemberEnum, MemberX, MemberXiY, MemberXY, MetaSConstraint, MinOfAList, MinOfASet, MinSpanningTree, MinXYZ, MixedCstElt, MixedEqXY, ModuloXYC2, MultiCostRegular, NeqBoolSum, Not, NotEqualXC, NotEqualXY_C, NotEqualXYC, NotMemberBound, NotMemberEnum, NotMemberX, NotMemberXY, NSPStruct, Occurrence, OrderedGcc, PackSConstraint, PrecedenceDisjoint, PrecedenceImplied, PrecedenceReified, PrecedenceVDisjoint, PrecedenceVSDisjoint, Regular, ReifiedAllSConstraint, ReifiedBinImplication, ReifiedBinXnor, ReifiedBinXor, ReifiedIntSConstraint, ReifiedLargeAnd, ReifiedLargeNand, ReifiedLargeNor, ReifiedLargeOr, ScalarAtMost, SemiLeximinSConstraint, SetCard, SetEq, SetIntersection, SetLexicographicOrdering, SetNaryUnion, SetNotEq, SetUnion, SetValuePrecede, SignOp, SimpleChannelling, SimpleDTConstraint, SoftCumulative, SoftCumulativeSum, SoftIntSConstraint, SoftMultiCostRegular, SortingSConstraint, SubSetChannelling, SubTourConstraint, TempTaskConstraintWrapper, TimesXYZ, TreeSConstraint, UseResourcesEq, UseResourcesGeq, VariablePrecedenceDisjoint

public interface SConstraint<V extends Var>
extends Cloneable, IPretty, IExtensionnable


Field Summary
static Logger LOGGER
          Reference to an object for logging trace statements related to constraints over integers (using the java.util.logging package)
 
Method Summary
 int getConstraintIdx(int idx)
          Network management: Among all listeners linked to the idx-th variable of c, find the index of constraint c.
 SConstraintType getConstraintType()
          Return the type of constraint, ie the type of variable involved in the constraint
 int getFineDegree(int idx)
          Some global constraint might be able to provide some fine grained information about the "real" degree of a variables.
 int getNbVars()
          Network management: Get the number of variables involved in the constraint.
 V getVar(int i)
          Network management: Accessing the ith variable of a constraint.
 V getVarQuick(int i)
          Network management: Accessing the ith variable of a constraint.
 boolean isSatisfied()
          Semantic: Testing if the constraint is satisfied.
 AbstractSConstraint<V> opposite(Solver solver)
          computes the constraint modelling the counter-opposite condition of this
 void setConstraintIndex(int i, int idx)
          Network management: Storing that among all listeners linked to the i-th variable of c, this (the current constraint) is found at index idx.
 void setVar(int i, V v)
          Network management: Setting (or overwriting) the ith variable of a constraint.
 
Methods inherited from interface choco.IPretty
pretty
 
Methods inherited from interface choco.IExtensionnable
addExtension, getExtension
 

Field Detail

LOGGER

static final Logger LOGGER
Reference to an object for logging trace statements related to constraints over integers (using the java.util.logging package)

Method Detail

getNbVars

int getNbVars()
Network management: Get the number of variables involved in the constraint.

Returns:
number of variables involved in the constraint

getVar

V getVar(int i)
Network management: Accessing the ith variable of a constraint.

Parameters:
i - index of the variable in the constraint
Returns:
the i^th variable involved in the constraint

getVarQuick

V getVarQuick(int i)
Network management: Accessing the ith variable of a constraint.

Parameters:
i - index of the variable in the constraint
Returns:
the i^th variable involved in the constraint

setVar

void setVar(int i,
            V v)
Network management: Setting (or overwriting) the ith variable of a constraint.

Parameters:
i - index of the variable in the constraint
v - the variable (may be an IntDomainVar, SetVar, RealVar, ...

isSatisfied

boolean isSatisfied()
Semantic: Testing if the constraint is satisfied. Note that all variables involved in the constraint must be instantiated when this method is called.

Returns:
true if the constraint is satisfied

opposite

AbstractSConstraint<V> opposite(Solver solver)
computes the constraint modelling the counter-opposite condition of this

Parameters:
solver - the current solver
Returns:
a new constraint (modelling the opposite condition) @param solver

setConstraintIndex

void setConstraintIndex(int i,
                        int idx)
Network management: Storing that among all listeners linked to the i-th variable of c, this (the current constraint) is found at index idx.

Parameters:
i - index of the variable in the constraint
idx - index of the constraint in the among all listeners linked to that variable

getConstraintIdx

int getConstraintIdx(int idx)
Network management: Among all listeners linked to the idx-th variable of c, find the index of constraint c.

Parameters:
idx - index of the variable in the constraint
Returns:
index of the constraint within the variable network

getConstraintType

SConstraintType getConstraintType()
Return the type of constraint, ie the type of variable involved in the constraint

Returns:

getFineDegree

int getFineDegree(int idx)
Some global constraint might be able to provide some fine grained information about the "real" degree of a variables. For example the global constraint on clauses can give the real number of clauses on each variable

Parameters:
idx - index of the variable in the constraint
Returns:
a weight given to the variable by the constraint


Copyright © 2012. All Rights Reserved.