RBNpackage
Class ProbFormConvComb

java.lang.Object
  extended by RBNpackage.ProbForm
      extended by RBNpackage.ProbFormConvComb

public class ProbFormConvComb
extends ProbForm


Field Summary
 
Fields inherited from class RBNpackage.ProbForm
RSymbs, SSymbs
 
Constructor Summary
ProbFormConvComb()
           
ProbFormConvComb(ProbForm f1, ProbForm f2, ProbForm f3)
          Creates new ProbFormConvComb
 
Method Summary
 java.lang.String asString()
           
 java.lang.String asString(int depth)
           
 java.lang.String asString(int depth, RelStruc A)
           
 java.lang.String asString(RelStruc A)
           
 ProbForm conditionEvidence(Instantiation inst)
           
 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.
 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.
 double evalSample(RelStruc A, java.util.Hashtable atomhasht, Instantiation inst, long[] timers)
          Evaluate this probform over RelStruc A.
 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.
 int evaluatesTo(RelStruc A)
           
 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.
 ProbForm f1()
           
 ProbForm f2()
           
 ProbForm f3()
           
 java.lang.String[] freevars()
          returns the free variables of the formula
 java.util.Vector makeParentVec(RelStruc A)
          returns the vector of (ground!) Atoms on which the evaluation of the probform depends
 java.util.Vector makeParentVec(RelStruc A, Instantiation inst)
          same as previous but with respect to the given truth values in the Instantiation argument
 boolean multlinOnly()
          returns true if ProbForm only contains multilinear combination functions
 java.lang.String[] parameters()
          Returns all the parameters that this ProbForm depends on
 void setParameters(java.lang.String[] params, double[] values)
          Sets all occurrences of parameters appearing in params to their corresponding value in values.
 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)
 ProbForm subPF(int i)
           
 ProbForm substitute(java.lang.String[] vars, int[] args)
          returns the formula obtained by substituting args for the vars in the formula.
 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
 

Constructor Detail

ProbFormConvComb

public ProbFormConvComb()

ProbFormConvComb

public ProbFormConvComb(ProbForm f1,
                        ProbForm f2,
                        ProbForm f3)
Creates new ProbFormConvComb

Method Detail

freevars

public java.lang.String[] freevars()
Description copied from class: ProbForm
returns the free variables of the formula

Specified by:
freevars in class ProbForm

multlinOnly

public boolean multlinOnly()
Description copied from class: ProbForm
returns true if ProbForm only contains multilinear combination functions

Specified by:
multlinOnly in class ProbForm

substitute

public ProbForm substitute(java.lang.String[] vars,
                           int[] args)
Description copied from class: ProbForm
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

Specified by:
substitute in class ProbForm

substitute

public ProbForm substitute(java.lang.String[] vars,
                           java.lang.String[] args)
Specified by:
substitute in class ProbForm

makeParentVec

public java.util.Vector makeParentVec(RelStruc A)
                               throws RBNCompatibilityException
Description copied from class: ProbForm
returns the vector of (ground!) Atoms on which the evaluation of the probform depends

Specified by:
makeParentVec in class ProbForm
Throws:
RBNCompatibilityException

makeParentVec

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

Specified by:
makeParentVec in class ProbForm
Throws:
RBNCompatibilityException

conditionEvidence

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

Specified by:
conditionEvidence in class ProbForm
Throws:
RBNCompatibilityException

conditionEvidence

public ProbForm conditionEvidence(Instantiation inst)
Specified by:
conditionEvidence in class ProbForm

f1

public ProbForm f1()

f2

public ProbForm f2()

f3

public ProbForm f3()

dependsOn

public boolean dependsOn(java.lang.String variable,
                         RelStruc A,
                         Instantiation data)
                  throws RBNCompatibilityException
Description copied from class: ProbForm
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

Specified by:
dependsOn in class ProbForm
Throws:
RBNCompatibilityException

evaluate

public double evaluate(RelStruc A,
                       Instantiation inst,
                       java.lang.String[] vars,
                       int[] tuple,
                       boolean useCurrentCvals)
                throws RBNCompatibilityException
Description copied from class: ProbForm
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 != "".

Specified by:
evaluate in class ProbForm
Throws:
RBNCompatibilityException

evalSample

public double evalSample(RelStruc A,
                         java.util.Hashtable atomhasht,
                         Instantiation inst,
                         long[] timers)
                  throws RBNCompatibilityException
Description copied from class: ProbForm
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

Specified by:
evalSample in class ProbForm
Throws:
RBNCompatibilityException

evaluatesTo

public int evaluatesTo(RelStruc A)
                throws RBNCompatibilityException
Specified by:
evaluatesTo in class ProbForm
Throws:
RBNCompatibilityException

evaluatesTo

public int evaluatesTo(RelStruc A,
                       Instantiation inst,
                       boolean usesampleinst,
                       java.util.Hashtable atomhasht)
                throws RBNCompatibilityException
Description copied from class: ProbForm
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

Specified by:
evaluatesTo in class ProbForm
Throws:
RBNCompatibilityException

parameters

public java.lang.String[] parameters()
Description copied from class: ProbForm
Returns all the parameters that this ProbForm depends on

Specified by:
parameters in class ProbForm

asString

public java.lang.String asString(int depth)
Specified by:
asString in class ProbForm

asString

public java.lang.String asString()
Specified by:
asString in class ProbForm

asString

public java.lang.String asString(RelStruc A)
Specified by:
asString in class ProbForm

asString

public java.lang.String asString(int depth,
                                 RelStruc A)
Specified by:
asString in class ProbForm

sEval

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

Specified by:
sEval in class ProbForm
Throws:
RBNCompatibilityException

subPF

public ProbForm subPF(int i)

setParameters

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

Specified by:
setParameters in class ProbForm