public class PropositionalVariable extends PropositionalConstraint
true
, then the classifier application did result in
the specified prediction value.Modifier and Type | Field and Description |
---|---|
protected Learner |
classifier
The classifier being applied.
|
protected Object |
example
The classifier is applied to this example object.
|
protected String |
prediction
The prediction that the classifier must produce for this variable to be
true . |
boolean |
value
The value imposed on this variable.
|
Constructor and Description |
---|
PropositionalVariable(Learner c,
Object e,
String p)
Initializing constructor; the
value member variable is set to false
. |
Modifier and Type | Method and Description |
---|---|
PropositionalConstraint |
CNF()
Produces a new, logically simplified version of this constraint in conjunctive normal form
(CNF).
|
void |
consolidateVariables(AbstractMap m)
Replaces all unquantified variables with the unique copy stored as a value of the given map;
also instantiates all quantified variables and stores them in the given map.
|
PropositionalConstraint |
DNF()
Produces a new, logically simplified version of this constraint in disjunctive normal form
(DNF).
|
boolean |
equals(Object o)
Two
PropositionalVariable s are equivalent when the string representations of
their classifiers are equivalent, they store the same example object, and their values are
equivalent. |
boolean |
evaluate()
Determines whether the constraint is satisfied.
|
Constraint[] |
getChildren()
Returns the children of this constraint in an array.
|
Learner |
getClassifier()
Retrieves the classifier.
|
Object |
getExample()
Retrieves the example object.
|
String |
getPrediction()
Retrieves the prediction.
|
int |
hashCode()
The hash code of a
PropositionalVariable is the hash code of the string
representation of the classifier plus the system's hash code for the example object plus the
hash code of the prediction. |
boolean |
moreGeneralThan(PropositionalConstraint c)
Compares topology to determine if this constraint is more general than the given constraint;
note: this method is not required to be correct when it answers
false . |
boolean |
moreSpecificThan(PropositionalAtLeast c)
Compares topology to determine if this constraint is more specific than the given at-least;
note: this method is not required to be correct when it answers
false . |
boolean |
moreSpecificThan(PropositionalConjunction c)
Compares topology to determine if this constraint is more specific than the given
conjunction; note: this method is not required to be correct when it answers
false . |
boolean |
moreSpecificThan(PropositionalConstant c)
Compares topology to determine if this constraint is more specific than the given constant;
note: this method is not required to be correct when it answers
false . |
boolean |
moreSpecificThan(PropositionalDisjunction c)
Compares topology to determine if this constraint is more specific than the given
disjunction; note: this method is not required to be correct when it answers
false . |
boolean |
moreSpecificThan(PropositionalDoubleImplication c)
Compares topology to determine if this constraint is more specific than the given double
implication; note: this method is not required to be correct when it answers
false . |
boolean |
moreSpecificThan(PropositionalImplication c)
Compares topology to determine if this constraint is more specific than the given
implication; note: this method is not required to be correct when it answers
false . |
boolean |
moreSpecificThan(PropositionalNegation c)
Compares topology to determine if this constraint is more specific than the given negation;
note: this method is not required to be correct when it answers
false . |
boolean |
moreSpecificThan(PropositionalVariable c)
Compares topology to determine if this constraint is more specific than the given variable;
note: this method is not required to be correct when it answers
false . |
PropositionalConstraint |
negate()
Produces a new propositional constraint equivalent to this constraint and that contains no
negated constraints other than variables.
|
void |
runVisit(Inference infer)
Calls the appropriate
visit(·) method of the given Inference
for this Constraint , as per the visitor pattern. |
PropositionalConstraint |
simplify()
Produces a new, logically simplified version of this constraint, preserving variable
consolidation.
|
void |
write(StringBuffer buffer)
Creates a string respresentation of this constraint using the string representations of the
objects involved.
|
clone, toString
protected Learner classifier
protected Object example
protected String prediction
true
.public boolean value
public PropositionalVariable(Learner c, Object e, String p)
value
member variable is set to false
.c
- The classifier being applied.e
- The classifier is applied to this example object.p
- The prediction associated with this variable.public void consolidateVariables(AbstractMap m)
consolidateVariables
in class Constraint
m
- The map in which to find unique copies of the variables.public Learner getClassifier()
public Object getExample()
public String getPrediction()
public boolean evaluate()
evaluate
in class Constraint
public PropositionalConstraint simplify()
simplify
in class PropositionalConstraint
Constraint.consolidateVariables(java.util.AbstractMap)
public PropositionalConstraint negate()
negate
in class PropositionalConstraint
public PropositionalConstraint CNF()
CNF
in class PropositionalConstraint
public PropositionalConstraint DNF()
DNF
in class PropositionalConstraint
public Constraint[] getChildren()
getChildren
in class Constraint
public boolean moreGeneralThan(PropositionalConstraint c)
false
.moreGeneralThan
in class PropositionalConstraint
c
- The given constraint.true
if a topological analysis determined that this constraint is more
general than the given constraint.public boolean moreSpecificThan(PropositionalImplication c)
false
.moreSpecificThan
in class PropositionalConstraint
c
- The given implication.true
if a topological analysis determined that this constraint is more
specific than the given implication.public boolean moreSpecificThan(PropositionalDoubleImplication c)
false
.moreSpecificThan
in class PropositionalConstraint
c
- The given double implication.true
if a topological analysis determined that this constraint is more
specific than the given double implication.public boolean moreSpecificThan(PropositionalConjunction c)
false
.moreSpecificThan
in class PropositionalConstraint
c
- The given conjunction.true
if a topological analysis determined that this constraint is more
specific than the given conjunction.public boolean moreSpecificThan(PropositionalDisjunction c)
false
.moreSpecificThan
in class PropositionalConstraint
c
- The given disjunction.true
if a topological analysis determined that this constraint is more
specific than the given disjunction.public boolean moreSpecificThan(PropositionalAtLeast c)
false
.moreSpecificThan
in class PropositionalConstraint
c
- The given at-least.true
if a topological analysis determined that this constraint is more
specific than the given disjunction.public boolean moreSpecificThan(PropositionalNegation c)
false
.moreSpecificThan
in class PropositionalConstraint
c
- The given negation.true
if a topological analysis determined that this constraint is more
specific than the given negation.public boolean moreSpecificThan(PropositionalVariable c)
false
.moreSpecificThan
in class PropositionalConstraint
c
- The given variable.true
if a topological analysis determined that this constraint is more
specific than the given variable.public boolean moreSpecificThan(PropositionalConstant c)
false
.moreSpecificThan
in class PropositionalConstraint
c
- The given constant.true
if a topological analysis determined that this constraint is more
specific than the given constant.public int hashCode()
PropositionalVariable
is the hash code of the string
representation of the classifier plus the system's hash code for the example object plus the
hash code of the prediction.public boolean equals(Object o)
PropositionalVariable
s are equivalent when the string representations of
their classifiers are equivalent, they store the same example object, and their values are
equivalent.public void runVisit(Inference infer)
visit(·)
method of the given Inference
for this Constraint
, as per the visitor pattern.runVisit
in class Constraint
infer
- The inference visiting this constraint.public void write(StringBuffer buffer)
write
in class PropositionalConstraint
buffer
- The output of this method will be appended to this buffer.Copyright © 2016. All rights reserved.