Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## cve
Class GenRule

    java.lang.Object
      |
      +--cve.GenRule

public class GenRule
extends java.lang.Object

A generalised rule is a context together with a factor.

Field Summary
`private Context` | `ruleContext`
`private Factor` | `ruleFactor`
`private Variable[]` | `rulesFor` the variables that this is a rule for.

Constructor Summary
`GenRule()` generated the new GenRule
`GenRule(Context con, Factor fact, Variable[] ruleIsFor)` generate a new instance from context con and factor fact.

Method Summary
`void` | `addResiduals(Context con, RuleCollection result)` adds the residuals of this with respect to Context con to result.
`Context` | `getContext()` returns the context.
`Factor` | `getFactor()` returns the factor of the generalised rule.
`Variable[]` | `getRulesFor()` returns the sorted lists of rules this is a rule for
`void` | `observe(Variable[] observedVars, int[] observedVals, RuleCollection resultingRules)` adds this rule to a rule collection given the observation.
`void` | `print()` print a generalised rule.
`void` | `printBrief()` prints a brief summary of the rule (without the probability table).
`boolean` | `redundant()` is true if the rule is redundant; if it is redundant it doesn't need to be added to the rule collection.
`boolean` | `ruleFor(Variable var)` is true if this rule is a rule for variable var.

Methods inherited from class java.lang.Object
`, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait`

Field Detail

### ruleContext

    private Context ruleContext

### ruleFactor

    private Factor ruleFactor

### rulesFor

    private Variable[] rulesFor

  the variables that this is a rule for.

Constructor Detail

### GenRule

    public GenRule(Context con,
                   Factor fact,
                   Variable[] ruleIsFor)

  generate a new instance from context con and factor fact.

### GenRule

    public GenRule()

  generated the new GenRule

Method Detail

### getContext

    public Context getContext()

  returns the context.

### getFactor

    public Factor getFactor()

  returns the factor of the generalised rule.

### ruleFor

    public boolean ruleFor(Variable var)

  is true if this rule is a rule for variable var.

### getRulesFor

    public Variable[] getRulesFor()

  returns the sorted lists of rules this is a rule for

### addResiduals

    public void addResiduals(Context con,
                             RuleCollection result)

  adds the residuals of this with respect to Context con to result.
  Parameters:
    `con` - a Context
    `result` - a Rule Collection of GenRule to add the new rules to.

### observe

    public void observe(Variable[] observedVars,
                        int[] observedVals,
                        RuleCollection resultingRules)

  adds this rule to a rule collection given the observation.

### redundant

    public boolean redundant()

  is true if the rule is redundant; if it is redundant it doesn't need to be added to the rule collection.

### print

    public void print()

  print a generalised rule.

### printBrief

    public void printBrief()

  prints a brief summary of the rule (without the probability table).

Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD