|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectedu.cs.ai.kreator.logic.metaconstraints.ExclusionConstraint
public class ExclusionConstraint
This class implements the MetaConstraint which excludes a set of constants from the substitution for a variable, e.g. [X != (anton, bert, cathy)]
| Constructor Summary | |
|---|---|
ExclusionConstraint(Variable var,
java.util.Collection<? extends Constant> consts)
Creates a new ExclusionConstraint object with a given
Variable and a given Collection of Constants. |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object obj)
Return true if other is a MetaConstraint and both have equal attributes. |
java.util.Set<Constant> |
getConstants()
|
java.util.Set<Variable> |
getVariables()
Returns all variables appearing in this constraint. |
int |
hashCode()
|
boolean |
isValidSubstitution(java.util.Map<Variable,Constant> substitution)
Checks if a given substitution violates this MetaConstraint. |
java.lang.String |
toLatex()
Returns a Latex grammar conform string to generate variables, rules (conditionals) etc. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ExclusionConstraint(Variable var,
java.util.Collection<? extends Constant> consts)
ExclusionConstraint object with a given
Variable and a given Collection of Constants.
var - the Variableconsts - the Constants| Method Detail |
|---|
public boolean isValidSubstitution(java.util.Map<Variable,Constant> substitution)
MetaConstraintMetaConstraint.
E.g if this is a NotEqualConstraint like X!=Y,
then substitution.get(X).equals(substitution.get(Y) == false will be returned.
If this is an ExclusionConstraint X != (v_1, ... ,v_n) then substitution.get(X).equals(v_1)
should hold for all 1<= i <= n.
isValidSubstitution in interface MetaConstraintsubstitution - the substitution to check.
MetaConstraint is violated by the given susbtitution.public java.lang.String toString()
toString in interface MetaConstrainttoString in class java.lang.ObjectString representation of this MetaConstraint.public java.lang.String toLatex()
Latexable
toLatex in interface LatexabletoLatex in interface MetaConstraintpublic java.util.Set<Variable> getVariables()
MetaConstraint
getVariables in interface MetaConstraintpublic java.util.Set<Constant> getConstants()
Constants which this ExclusionConstraint excludes for the Variable.public int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
MetaConstraintMetaConstraint and both have equal attributes.
equals in interface MetaConstraintequals in class java.lang.Objectobj - a Object
MetaConstraint and both have equal attributes.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||