RBNinference
Class SimplePFNetworkNode

java.lang.Object
  extended by RBNinference.BNNode
      extended by RBNinference.PFNetworkNode
          extended by RBNinference.SimplePFNetworkNode
All Implemented Interfaces:
GroundAtomNodeInt

public class SimplePFNetworkNode
extends PFNetworkNode


Field Summary
protected  double[][] conditionalsampleweightsfalse
          conditionalsampleweightsfalse[i]: sum of all weights of samples in which i'th parent configuration was sampled and this node was sampled false (in a run of importance sampling).
protected  double[][][] conditionalsampleweightsfalse_subsample
          array of dimensions 2 x num_parentconfig x num_samples conditionalsampleweightsfalse_subsample[i][j] contains the sum of weights (represented as SmallDouble) of all samples assigned to the jth subsample with parentconfig i where this node is sampled false
protected  double[][] conditionalsampleweightstrue
          conditionalsampleweightstrue[i]: sum of all weights of samples in which i'th parent configuration was sampled and this node was sampled true (in a run of importance sampling).
protected  double[][][] conditionalsampleweightstrue_subsample
          array of dimensions 2 x num_parentconfig x num_samples conditionalsampleweightstrue_subsample[i][j] contains the sum of weights (represented as SmallDouble) of all samples assigned to the jth subsample with parentconfig i where this node is sampled true
protected  int[] numfalsesamples
          numtruesamples[i]: number of samples in which i'th parent configuration was sampled and this node was sampled false (in a run of importance sampling).
protected  int[][] numfalsesamples_subsample
           
protected  int[] numtruesamples
          numtruesamples[i]: number of samples in which i'th parent configuration was sampled and this node was sampled true (in a run of importance sampling).
protected  int[][] numtruesamples_subsample
           
protected  int[] sampleindex
           
protected  double[] trueodds_variance
           
 
Fields inherited from class RBNinference.PFNetworkNode
myatom, sampledepth, sampleinst, sampleparentconfig, thisdistrprob, thissampleprob, truesampleweight, truesampleweight_subsample, upstreamofevidence
 
Fields inherited from class RBNinference.BNNode
children, depth, instantiated, name, parents
 
Constructor Summary
SimplePFNetworkNode(Atom at)
           
SimplePFNetworkNode(ComplexPFNetworkNode cpfn, Instantiation inst, RelStruc A)
           
 
Method Summary
 double[][] conditionalsampleweightsfalse()
           
 double[][] conditionalsampleweightstrue()
           
 int evaluatesTo(boolean usesampleinst)
           
 int evaluatesTo(RelStruc A, Instantiation inst, boolean usesampleinst, java.util.Hashtable atomhasht)
           
 void initializeForSampling(int sampleordmode, int adaptivemode, AtomList queryatoms, int nsm, int nsa)
           
 boolean isIsolatedZeroNode(RelStruc rels)
           
 double[] mycpt()
           
 int parentConfig()
           
 void sampleForward(RelStruc A, java.util.Hashtable atomhasht, Instantiation inst, int adaptivemode, long[] timers)
           
 void sampleForward(RelStruc A, int adaptivemode)
           
 void setDistrProb(RelStruc A, java.util.Hashtable atomhasht, Instantiation inst, long[] timers)
           
 java.lang.String showNumFalse()
           
 java.lang.String showNumTrue()
           
 void updateconditionalsampleweights(RelStruc A, double[] weight)
           
 void updateconditionalsampleweightsnew()
           
 
Methods inherited from class RBNinference.PFNetworkNode
addToTruesampleweight, initializeForNextSample, isLocallyConsistent, myatom, propagateDeterministic, sample, sampledepth, sampleinstantiate, sampleinstVal, sampleRipple, setSampleDepth, setSampleProb, setUpstreamOfEvidence, thisdistrprob, thissampleprob, truesampleweight_subsample, truesampleweight, upstreamOfEvidence
 
Methods inherited from class RBNinference.BNNode
addToChildren, addToParents, buildNodeStack, depth, familyXcenter, instantiate, instantiatedTo, parentsSubset, replaceInChildrenList, replaceInParentList, resetParents, resetVisited, resetVisitedUpDownstream, resetVisitedUpstream, setDepth, showAllReachable, sizeFamily, xSum
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

conditionalsampleweightsfalse

protected double[][] conditionalsampleweightsfalse
conditionalsampleweightsfalse[i]: sum of all weights of samples in which i'th parent configuration was sampled and this node was sampled false (in a run of importance sampling). Represented as SmallDoubles Initialized to [0,...,0]. Only used in adaptive sampling


conditionalsampleweightstrue

protected double[][] conditionalsampleweightstrue
conditionalsampleweightstrue[i]: sum of all weights of samples in which i'th parent configuration was sampled and this node was sampled true (in a run of importance sampling). Initialized to [0,...,0]. Only used in adaptive sampling


numtruesamples

protected int[] numtruesamples
numtruesamples[i]: number of samples in which i'th parent configuration was sampled and this node was sampled true (in a run of importance sampling). Initialized to [0,...,0]. Only used in adaptive sampling


numfalsesamples

protected int[] numfalsesamples
numtruesamples[i]: number of samples in which i'th parent configuration was sampled and this node was sampled false (in a run of importance sampling). Initialized to [0,...,0]. Only used in adaptive sampling


conditionalsampleweightsfalse_subsample

protected double[][][] conditionalsampleweightsfalse_subsample
array of dimensions 2 x num_parentconfig x num_samples conditionalsampleweightsfalse_subsample[i][j] contains the sum of weights (represented as SmallDouble) of all samples assigned to the jth subsample with parentconfig i where this node is sampled false


conditionalsampleweightstrue_subsample

protected double[][][] conditionalsampleweightstrue_subsample
array of dimensions 2 x num_parentconfig x num_samples conditionalsampleweightstrue_subsample[i][j] contains the sum of weights (represented as SmallDouble) of all samples assigned to the jth subsample with parentconfig i where this node is sampled true


numtruesamples_subsample

protected int[][] numtruesamples_subsample

numfalsesamples_subsample

protected int[][] numfalsesamples_subsample

trueodds_variance

protected double[] trueodds_variance

sampleindex

protected int[] sampleindex
Constructor Detail

SimplePFNetworkNode

public SimplePFNetworkNode(Atom at)

SimplePFNetworkNode

public SimplePFNetworkNode(ComplexPFNetworkNode cpfn,
                           Instantiation inst,
                           RelStruc A)
                    throws RBNCompatibilityException
Throws:
RBNCompatibilityException
Method Detail

mycpt

public double[] mycpt()

conditionalsampleweightstrue

public double[][] conditionalsampleweightstrue()

conditionalsampleweightsfalse

public double[][] conditionalsampleweightsfalse()

evaluatesTo

public int evaluatesTo(RelStruc A,
                       Instantiation inst,
                       boolean usesampleinst,
                       java.util.Hashtable atomhasht)
Specified by:
evaluatesTo in class PFNetworkNode

evaluatesTo

public int evaluatesTo(boolean usesampleinst)

isIsolatedZeroNode

public boolean isIsolatedZeroNode(RelStruc rels)
                           throws RBNCompatibilityException
Throws:
RBNCompatibilityException

initializeForSampling

public void initializeForSampling(int sampleordmode,
                                  int adaptivemode,
                                  AtomList queryatoms,
                                  int nsm,
                                  int nsa)
Overrides:
initializeForSampling in class PFNetworkNode

sampleForward

public void sampleForward(RelStruc A,
                          java.util.Hashtable atomhasht,
                          Instantiation inst,
                          int adaptivemode,
                          long[] timers)
Specified by:
sampleForward in class PFNetworkNode

sampleForward

public void sampleForward(RelStruc A,
                          int adaptivemode)

parentConfig

public int parentConfig()

setDistrProb

public void setDistrProb(RelStruc A,
                         java.util.Hashtable atomhasht,
                         Instantiation inst,
                         long[] timers)
Specified by:
setDistrProb in class PFNetworkNode

showNumTrue

public java.lang.String showNumTrue()

showNumFalse

public java.lang.String showNumFalse()

updateconditionalsampleweights

public void updateconditionalsampleweights(RelStruc A,
                                           double[] weight)

updateconditionalsampleweightsnew

public void updateconditionalsampleweightsnew()