public class CPT extends java.lang.Object implements ConditionalProbabilityTable
| Constructor and Description |
|---|
CPT(RandomVariable on,
double[] values,
RandomVariable... conditionedOn) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(RandomVariable rv) |
CategoricalDistribution |
getConditioningCase(AssignmentProposition... parentValues)
A conditioning case is just a possible combination of values for the
parent nodes - a miniature possible world, if you like.
|
CategoricalDistribution |
getConditioningCase(java.lang.Object... parentValues)
A conditioning case is just a possible combination of values for the
parent nodes - a miniature possible world, if you like.
|
Factor |
getFactorFor(AssignmentProposition... evidence)
Construct a Factor consisting of the Random Variables from the
Conditional Probability Table that are not part of the evidence (see
AIMA3e pg.
|
java.util.Set<RandomVariable> |
getFor()
A convenience method for merging the elements of getParents() and getOn()
into a consistent ordered set (i.e.
|
RandomVariable |
getOn() |
java.util.Set<RandomVariable> |
getParents() |
java.lang.Object |
getSample(double probabilityChoice,
AssignmentProposition... parentValues)
Retrieve a specific example for the Random Variable this conditional
distribution is on.
|
java.lang.Object |
getSample(double probabilityChoice,
java.lang.Object... parentValues)
Retrieve a specific example for the Random Variable this conditional
distribution is on.
|
double |
getValue(AssignmentProposition... eventValues)
Get the value for the provided set of AssignmentPropositions for the
random variables comprising the Conditional Distribution (size of each
must equal and their random variables must match).
|
double |
getValue(java.lang.Object... eventValues)
Get the value for the provided set of values for the random variables
comprising the Conditional Distribution (ordering and size of each must
equal getFor() and their domains must match).
|
double |
probabilityFor(java.lang.Object... values) |
public CPT(RandomVariable on, double[] values, RandomVariable... conditionedOn)
public double probabilityFor(java.lang.Object... values)
public RandomVariable getOn()
getOn in interface ConditionalProbabilityDistributionpublic java.util.Set<RandomVariable> getParents()
getParents in interface ConditionalProbabilityDistributionpublic java.util.Set<RandomVariable> getFor()
ConditionalProbabilityDistributiongetFor in interface ConditionalProbabilityDistributionpublic boolean contains(RandomVariable rv)
contains in interface ConditionalProbabilityDistributionrv - the Random Variable to be checked.public double getValue(java.lang.Object... eventValues)
ConditionalProbabilityDistributiongetValue in interface ConditionalProbabilityDistributioneventValues - the values for the random variables comprising the Conditional
Distributionpublic double getValue(AssignmentProposition... eventValues)
ConditionalProbabilityDistributiongetValue in interface ConditionalProbabilityDistributioneventValues - the assignment propositions for the random variables
comprising the Conditional Distributionpublic java.lang.Object getSample(double probabilityChoice,
java.lang.Object... parentValues)
ConditionalProbabilityDistributiongetSample in interface ConditionalProbabilityDistributionprobabilityChoice - a double value, from the range [0.0d, 1.0d), i.e. 0.0d
(inclusive) to 1.0d (exclusive).parentValues - for the conditioning case. The ordering and size of
parentValues must equal getParents() and their domains must
match.ConditionalProbabilityDistribution.getOn()public java.lang.Object getSample(double probabilityChoice,
AssignmentProposition... parentValues)
ConditionalProbabilityDistributiongetSample in interface ConditionalProbabilityDistributionprobabilityChoice - a double value, from the range [0.0d, 1.0d), i.e. 0.0d
(inclusive) to 1.0d (exclusive).parentValues - for the conditioning case. The size of parentValues must equal
getParents() and their Random Variables must match.ConditionalProbabilityDistribution.getOn()public CategoricalDistribution getConditioningCase(java.lang.Object... parentValues)
ConditionalProbabilityDistributiongetConditioningCase in interface ConditionalProbabilityDistributiongetConditioningCase in interface ConditionalProbabilityTableparentValues - for the conditioning case. The ordering and size of
parentValues must equal getParents() and their domains must
match.ConditionalProbabilityDistribution.getOn(),
ConditionalProbabilityDistribution.getParents()public CategoricalDistribution getConditioningCase(AssignmentProposition... parentValues)
ConditionalProbabilityDistributiongetConditioningCase in interface ConditionalProbabilityDistributiongetConditioningCase in interface ConditionalProbabilityTableparentValues - for the conditioning case. The size of parentValues must equal
getParents() and their Random Variables must match.ConditionalProbabilityDistribution.getOn(),
ConditionalProbabilityDistribution.getParents()public Factor getFactorFor(AssignmentProposition... evidence)
ConditionalProbabilityTablegetFactorFor in interface ConditionalProbabilityTable