Class Rules
- java.lang.Object
-
- org.chocosolver.solver.explanations.Rules
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPaRules(int pid)Add a propagator activation rule for 'pid'voidclear()Clear thisbooleangetPaRules(int pid)Get the propagator activation rule associated with 'pid'gnu.trove.set.TIntSetgetVmRemval(int vid)Get the removed values associated with 'vid'intgetVmRules(int vid)Get the variable modification rule associated with 'vid'booleanintersect(int i1, int i2, int vid)Check whether an interval intersects at least one value from a given setbooleanisEmpty()voidor(Rules rules)Merge 'rules' into thisvoidpaRulesClear(int pid)Clear the propagator activation rule associated with 'pid'booleanputMask(int vid, int mask)Update the rule mask for a given variable (denoted by its vid)
-
-
-
Method Detail
-
getPaRules
public boolean getPaRules(int pid)
Get the propagator activation rule associated with 'pid'- Parameters:
pid- a propagator id- Returns:
- true if the rule exists
-
paRulesClear
public void paRulesClear(int pid)
Clear the propagator activation rule associated with 'pid'- Parameters:
pid- a propagator id
-
addPaRules
public void addPaRules(int pid)
Add a propagator activation rule for 'pid'- Parameters:
pid- a propagator id
-
getVmRules
public int getVmRules(int vid)
Get the variable modification rule associated with 'vid'- Parameters:
vid- a variable id- Returns:
- the mask of rules
-
getVmRemval
public gnu.trove.set.TIntSet getVmRemval(int vid)
Get the removed values associated with 'vid'- Parameters:
vid- the variable id- Returns:
- the set of removed values up to now
-
putMask
public boolean putMask(int vid, int mask)Update the rule mask for a given variable (denoted by its vid)- Parameters:
vid- the index of the variablemask- the new mask to merge- Returns:
- true if the mask has been updated (false = already existing mask)
-
clear
public void clear()
Clear this
-
intersect
public boolean intersect(int i1, int i2, int vid)Check whether an interval intersects at least one value from a given set- Parameters:
i1- lower bound of the interval (included)i2- upper bound of the interval (included)vid- variable id- Returns:
- true if intersection is not empty
-
or
public void or(Rules rules)
Merge 'rules' into this- Parameters:
rules- a set of rules
-
isEmpty
public boolean isEmpty()
- Returns:
- true if the rules are not valuated, meaning that the explanation is complete
-
-