choco.cp.solver.constraints.integer.bool.sum
Class BoolSumStructure

java.lang.Object
  extended by choco.cp.solver.constraints.integer.bool.sum.BoolSumStructure

public final class BoolSumStructure
extends Object

A special case of sums over boolean variables only


Field Summary
 int bGap
           
 int bValue
           
protected  AbstractSConstraint<?> cstr
           
 IStateInt nbo
          The number of variables instantiated to one in the sum
 IStateInt nbz
          The number of variables instantiated to zero in the sum
protected  IntDomainVar[] vars
           
 
Constructor Summary
BoolSumStructure(IEnvironment environment, AbstractSConstraint<?> cstr, IntDomainVar[] vars, int bValue)
           
 
Method Summary
 void addOne()
           
 void addZero()
           
 void awakeOnEq()
           
 void awakeOnGeq()
           
 void awakeOnLeq()
           
 void awakeOnNeq()
           
 int computeLbFromScratch()
          Computes a lower bound estimate of a linear combination of variables.
 int computeUbFromScratch()
          Computes an upper bound estimate of a linear combination of variables.
 boolean filterGeq()
           
 boolean filterLeq()
           
 void forceAllOne()
           
 void forceAllZero()
           
 int getbGap()
           
 IntDomainVar[] getBoolVars()
           
 int getbValue()
           
 IStateInt getNbOne()
           
 IStateInt getNbZero()
           
 Boolean isEntailedEq()
           
 Boolean isEntailedGeq()
           
 Boolean isEntailedLeq()
           
 Boolean isEntailedNeq()
           
 String pretty(String operator)
           
 void putAllOne()
           
 void putAllZero()
           
 void reset()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vars

protected final IntDomainVar[] vars

cstr

protected final AbstractSConstraint<?> cstr

nbz

public final IStateInt nbz
The number of variables instantiated to zero in the sum


nbo

public final IStateInt nbo
The number of variables instantiated to one in the sum


bGap

public final int bGap

bValue

public final int bValue
Constructor Detail

BoolSumStructure

public BoolSumStructure(IEnvironment environment,
                        AbstractSConstraint<?> cstr,
                        IntDomainVar[] vars,
                        int bValue)
Method Detail

getBoolVars

public final IntDomainVar[] getBoolVars()

getNbZero

public final IStateInt getNbZero()

getNbOne

public final IStateInt getNbOne()

getbGap

public final int getbGap()

getbValue

public final int getbValue()

reset

public final void reset()

filterLeq

public final boolean filterLeq()
                        throws ContradictionException
Throws:
ContradictionException

filterGeq

public final boolean filterGeq()
                        throws ContradictionException
Throws:
ContradictionException

putAllZero

public final void putAllZero()
                      throws ContradictionException
Throws:
ContradictionException

forceAllZero

public final void forceAllZero()
                        throws ContradictionException
Throws:
ContradictionException

putAllOne

public final void putAllOne()
                     throws ContradictionException
Throws:
ContradictionException

forceAllOne

public final void forceAllOne()
                       throws ContradictionException
Throws:
ContradictionException

addOne

public final void addOne()

addZero

public final void addZero()

awakeOnEq

public void awakeOnEq()
               throws ContradictionException
Throws:
ContradictionException

awakeOnGeq

public void awakeOnGeq()
                throws ContradictionException
Throws:
ContradictionException

awakeOnLeq

public void awakeOnLeq()
                throws ContradictionException
Throws:
ContradictionException

awakeOnNeq

public void awakeOnNeq()
                throws ContradictionException
Throws:
ContradictionException

computeUbFromScratch

public final int computeUbFromScratch()
Computes an upper bound estimate of a linear combination of variables.

Returns:
the new upper bound value

computeLbFromScratch

public final int computeLbFromScratch()
Computes a lower bound estimate of a linear combination of variables.

Returns:
the new lower bound value

isEntailedEq

public Boolean isEntailedEq()

isEntailedGeq

public Boolean isEntailedGeq()

isEntailedLeq

public Boolean isEntailedLeq()

isEntailedNeq

public Boolean isEntailedNeq()

pretty

public String pretty(String operator)


Copyright © 2012. All Rights Reserved.