choco.cp.solver.constraints.integer.intlincomb
Class IntLinCombOp

java.lang.Object
  extended by choco.cp.solver.constraints.integer.intlincomb.IntLinCombOp
Direct Known Subclasses:
IntLinCombEQ, IntLinCombGEQ, IntLinCombLEQ, IntLinCombNEQ

public abstract class IntLinCombOp
extends Object

User : cprudhom
Mail : cprudhom(a)emn.fr
Date : 11 mars 2010
Since : Choco 2.1.1


Method Summary
 int compute(int[] tuple)
           
 void filter(boolean startWithLB, int minNbRules)
          A strategy for chaotic iteration with two rules (LB and UB propagation).
protected abstract  boolean filterOnImprovedLowerBound()
          Checks a new lower bound.
protected abstract  boolean filterOnImprovedUpperBound()
          Checks a new upper bound.
protected abstract  String getOperator()
           
protected  boolean hasConsistentUpperBound()
          Tests if the constraint is consistent with respect to the current state of domains.
abstract  boolean isConsistent()
          Tests if the constraint is consistent with respect to the current state of domains.
abstract  Boolean isEntailed()
          Checks if the constraint is entailed.
abstract  boolean isSatisfied(int[] tuple)
          Checks if the constraint is satisfied when all variables are instantiated.
abstract  AbstractSConstraint opposite(Solver solver)
          Computes the opposite of this constraint.
 String pretty()
          Pretty print for this constraint.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isEntailed

public abstract Boolean isEntailed()
Checks if the constraint is entailed.

Returns:
Boolean.TRUE if the constraint is satisfied, Boolean.FALSE if it is violated, and null if the filtering algorithm cannot infer yet.

isSatisfied

public abstract boolean isSatisfied(int[] tuple)
Checks if the constraint is satisfied when all variables are instantiated.

Parameters:
tuple - array of values
Returns:
true if the constraint is satisfied

compute

public final int compute(int[] tuple)

filterOnImprovedLowerBound

protected abstract boolean filterOnImprovedLowerBound()
                                               throws ContradictionException
Checks a new lower bound.

Returns:
true if filtering has been infered
Throws:
ContradictionException - if a domain empties or a contradiction is infered

filterOnImprovedUpperBound

protected abstract boolean filterOnImprovedUpperBound()
                                               throws ContradictionException
Checks a new upper bound.

Returns:
true if filtering has been infered
Throws:
ContradictionException - if a domain empties or a contradiction is infered

isConsistent

public abstract boolean isConsistent()
Tests if the constraint is consistent with respect to the current state of domains.

Returns:
true iff the constraint is bound consistent (weaker than arc consistent)

opposite

public abstract AbstractSConstraint opposite(Solver solver)
Computes the opposite of this constraint.

Parameters:
solver - containing solver
Returns:
a constraint with the opposite semantic @param solver

filter

public final void filter(boolean startWithLB,
                         int minNbRules)
                  throws ContradictionException
A strategy for chaotic iteration with two rules (LB and UB propagation). The fix point is reached individually for each rule in one function call but this call may break the stability condition for the other rule (in which case the second rule infers new information from the fresh inferences made by the first rule) . The algorithm oscilates between both rules until a global fix point is reached.

Parameters:
startWithLB - whether LB must be the first rule applied
minNbRules - minimum number of rules required to reach fix point.
Throws:
ContradictionException - if a domain empties or a contradiction is infered

hasConsistentUpperBound

protected final boolean hasConsistentUpperBound()
Tests if the constraint is consistent with respect to the current state of domains.

Returns:
true iff the constraint is bound consistent (weaker than arc consistent)

getOperator

protected abstract String getOperator()

pretty

public String pretty()
Pretty print for this constraint. This method prints the complete equations.

Returns:
a strring representation of the constraint


Copyright © 2012. All Rights Reserved.