RBNpackage
Class ProbForm

java.lang.Object
  extended by RBNpackage.ProbForm
Direct Known Subclasses:
ProbFormCombFunc, ProbFormConstant, ProbFormConvComb, ProbFormIndicator, ProbFormSFormula

public abstract class ProbForm
extends java.lang.Object


Field Summary
 Rel[] RSymbs
           
 Rel[] SSymbs
           
 
Constructor Summary
ProbForm()
           
 
Method Summary
abstract  java.lang.String asString()
           
abstract  java.lang.String asString(int depth)
           
abstract  java.lang.String asString(int depth, RelStruc A)
           
abstract  java.lang.String asString(RelStruc A)
           
abstract  ProbForm conditionEvidence(Instantiation inst)
           
abstract  ProbForm conditionEvidence(RelStruc A, Instantiation inst)
          Simplify ProbForm by substituting values of instantiated R-atoms and evaluating subformulas no longer dependent on any uninstantiated R-atom.
abstract  boolean dependsOn(java.lang.String variable, RelStruc A, Instantiation data)
          Checks whether this prob.form depends on the unknown parameter 'variable' when prob.form is evaluated over input structure A and relative to instantiation (data) data.
abstract  double evalSample(RelStruc A, java.util.Hashtable atomhasht, Instantiation inst, long[] timers)
          Evaluate this probform over RelStruc A.
abstract  double evaluate(RelStruc A, Instantiation inst, java.lang.String[] vars, int[] tuple, boolean useCurrentCvals)
          Evaluate this ProbForm for input structure A, instantiation inst, under the substitution tuple for vars.
abstract  int evaluatesTo(RelStruc A)
           
abstract  int evaluatesTo(RelStruc A, Instantiation inst, boolean usesampleinst, java.util.Hashtable atomhasht)
          Returns 0 if this probform evaluates to zero over structure A and with respect to instantiation inst, but irrespective of any instantiation of other probabilistic atoms.
abstract  java.lang.String[] freevars()
          returns the free variables of the formula
abstract  java.util.Vector makeParentVec(RelStruc A)
          returns the vector of (ground!) Atoms on which the evaluation of the probform depends
abstract  java.util.Vector makeParentVec(RelStruc A, Instantiation inst)
          same as previous but with respect to the given truth values in the Instantiation argument
abstract  boolean multlinOnly()
          returns true if ProbForm only contains multilinear combination functions
abstract  java.lang.String[] parameters()
          Returns all the parameters that this ProbForm depends on
abstract  void setParameters(java.lang.String[] params, double[] values)
          Sets all occurrences of parameters appearing in params to their corresponding value in values.
abstract  ProbForm sEval(RelStruc A)
          Returns a ProbForm in which the dependence on A is already pre-evaluated (substitution lists in combination functions, and values of ProbFormSFormula)
abstract  ProbForm substitute(java.lang.String[] vars, int[] args)
          returns the formula obtained by substituting args for the vars in the formula.
abstract  ProbForm substitute(java.lang.String[] vars, java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SSymbs

public Rel[] SSymbs

RSymbs

public Rel[] RSymbs
Constructor Detail

ProbForm

public ProbForm()
Method Detail

asString

public abstract java.lang.String asString(int depth)

asString

public abstract java.lang.String asString()

asString

public abstract java.lang.String asString(int depth,
                                          RelStruc A)

asString

public abstract java.lang.String asString(RelStruc A)

conditionEvidence

public abstract ProbForm conditionEvidence(RelStruc A,
                                           Instantiation inst)
                                    throws RBNCompatibilityException
Simplify ProbForm by substituting values of instantiated R-atoms and evaluating subformulas no longer dependent on any uninstantiated R-atom.

Throws:
RBNCompatibilityException

conditionEvidence

public abstract ProbForm conditionEvidence(Instantiation inst)

dependsOn

public abstract boolean dependsOn(java.lang.String variable,
                                  RelStruc A,
                                  Instantiation data)
                           throws RBNCompatibilityException
Checks whether this prob.form depends on the unknown parameter 'variable' when prob.form is evaluated over input structure A and relative to instantiation (data) data. Only for ground probforms! For argument variable = "unknown_atom" the method returns true if this ProbForm depends on a ground atom not instantiated in data

Throws:
RBNCompatibilityException

evaluate

public abstract double evaluate(RelStruc A,
                                Instantiation inst,
                                java.lang.String[] vars,
                                int[] tuple,
                                boolean useCurrentCvals)
                         throws RBNCompatibilityException
Evaluate this ProbForm for input structure A, instantiation inst, under the substitution tuple for vars. Returns -1 if the value of probform is not defined because it depends on a probabilistic atom not instantiated in inst. If useCurrentCvals=false then also returns -1 if value depends on an unknown parameter. If useCurrentCvals=true, then evaluation at ProbFormConstant's is done with regard to their cval field, even when their paramname != "".

Throws:
RBNCompatibilityException

evalSample

public abstract double evalSample(RelStruc A,
                                  java.util.Hashtable atomhasht,
                                  Instantiation inst,
                                  long[] timers)
                           throws RBNCompatibilityException
Evaluate this probform over RelStruc A. For ground atoms on which probform depends, a ComplexBNGroundAtomNode is accessible via atomhasht (using Atom.asString() as hashcode) If this ComplexBNGroundAtomNode is not instantiated, then the sample method of that node has to be called

Throws:
RBNCompatibilityException

evaluatesTo

public abstract int evaluatesTo(RelStruc A,
                                Instantiation inst,
                                boolean usesampleinst,
                                java.util.Hashtable atomhasht)
                         throws RBNCompatibilityException
Returns 0 if this probform evaluates to zero over structure A and with respect to instantiation inst, but irrespective of any instantiation of other probabilistic atoms. When probform contains unknown parameters, then evaluatesTo is computed with regard to the current setting of cval at the parameter ProbFormConstants. Returns 1 if ... evaluates to one .... Returns -1 if neither of the above When usesampleinst = true, then evaluation is not w.r.t. instantiation inst, but w.r.t. to sampleinst fields at PFNetworkNodes which are accessible via atomhasht

Throws:
RBNCompatibilityException

evaluatesTo

public abstract int evaluatesTo(RelStruc A)
                         throws RBNCompatibilityException
Throws:
RBNCompatibilityException

freevars

public abstract java.lang.String[] freevars()
returns the free variables of the formula


makeParentVec

public abstract java.util.Vector makeParentVec(RelStruc A)
                                        throws RBNCompatibilityException
returns the vector of (ground!) Atoms on which the evaluation of the probform depends

Throws:
RBNCompatibilityException

makeParentVec

public abstract java.util.Vector makeParentVec(RelStruc A,
                                               Instantiation inst)
                                        throws RBNCompatibilityException
same as previous but with respect to the given truth values in the Instantiation argument

Throws:
RBNCompatibilityException

multlinOnly

public abstract boolean multlinOnly()
returns true if ProbForm only contains multilinear combination functions


parameters

public abstract java.lang.String[] parameters()
Returns all the parameters that this ProbForm depends on


sEval

public abstract ProbForm sEval(RelStruc A)
                        throws RBNCompatibilityException
Returns a ProbForm in which the dependence on A is already pre-evaluated (substitution lists in combination functions, and values of ProbFormSFormula)

Throws:
RBNCompatibilityException

substitute

public abstract ProbForm substitute(java.lang.String[] vars,
                                    int[] args)
returns the formula obtained by substituting args for the vars in the formula. Produces an error if vars are not among the free variables of the formula


substitute

public abstract ProbForm substitute(java.lang.String[] vars,
                                    java.lang.String[] args)

setParameters

public abstract void setParameters(java.lang.String[] params,
                                   double[] values)
Sets all occurrences of parameters appearing in params to their corresponding value in values. params and values must be arrays of the same length

Parameters:
params -
values -