RBNLearning
Class GradientGraphIndicatorNode

java.lang.Object
  extended by RBNLearning.GradientGraphNode
      extended by RBNLearning.GradientGraphProbFormNode
          extended by RBNLearning.GradientGraphIndicatorNode
All Implemented Interfaces:
java.lang.Comparable<GradientGraphNode>

public class GradientGraphIndicatorNode
extends GradientGraphProbFormNode


Field Summary
 
Fields inherited from class RBNLearning.GradientGraphProbFormNode
dependsOnParam
 
Constructor Summary
GradientGraphIndicatorNode(GradientGraph gg, ProbForm pf, RelStruc A, Instantiation I, int inputcasenoarg, int observcasenoarg)
           
 
Method Summary
 double evaluate()
          Evaluate this GradientGraphNode using current values of parameters and the current instantiation for unobserved atoms.
 void evaluateBounds()
           
 double evaluateGrad(int param)
           
 int getCurrentInst()
           
 void initSampledVals(int size)
          initializes sampledVals to an array of size 'size'
 int inputcaseno()
           
 Atom myatom()
           
 int observcaseno()
           
 void setCurrentInst(boolean tv)
          Sets the current instantiation according to the truth value tv
 void setCurrentInst(int sno)
          Sets the current instantiation according to the value in the sno's sample
 void setSampleVal(int sno)
          Sets value in sno's sample to current instantiation
 void setSampleVal(int sno, boolean tv)
          Sets value in sno's sample to tv
 void toggleCurrentInst()
           
 void toggleSampleVal(int sno)
          Toggles value in sno's sample
 void unset()
          Resets the currentInst field to -1, i.e.
 
Methods inherited from class RBNLearning.GradientGraphProbFormNode
constructGGPFN, dependsOn, lowerBound, name, resetBounds, upperBound
 
Methods inherited from class RBNLearning.GradientGraphNode
addToChildren, addToParents, ancestors, childrenSize, compareTo, equals, gradient, parents, reEvaluateUpstream, resetGradient, resetValue, value
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GradientGraphIndicatorNode

public GradientGraphIndicatorNode(GradientGraph gg,
                                  ProbForm pf,
                                  RelStruc A,
                                  Instantiation I,
                                  int inputcasenoarg,
                                  int observcasenoarg)
                           throws java.lang.RuntimeException,
                                  RBNCompatibilityException
Throws:
java.lang.RuntimeException
RBNCompatibilityException
Method Detail

evaluate

public double evaluate()
Description copied from class: GradientGraphNode
Evaluate this GradientGraphNode using current values of parameters and the current instantiation for unobserved atoms. Returns the value and sets the value field of the node. If the value is not null, then the this value is assumed to be the currently correct value, and is returned

Specified by:
evaluate in class GradientGraphNode

evaluateBounds

public void evaluateBounds()
Specified by:
evaluateBounds in class GradientGraphNode

evaluateGrad

public double evaluateGrad(int param)
Specified by:
evaluateGrad in class GradientGraphNode

myatom

public Atom myatom()

inputcaseno

public int inputcaseno()

observcaseno

public int observcaseno()

setCurrentInst

public void setCurrentInst(int sno)
Sets the current instantiation according to the value in the sno's sample


setSampleVal

public void setSampleVal(int sno,
                         boolean tv)
Sets value in sno's sample to tv


setSampleVal

public void setSampleVal(int sno)
Sets value in sno's sample to current instantiation


toggleSampleVal

public void toggleSampleVal(int sno)
Toggles value in sno's sample


setCurrentInst

public void setCurrentInst(boolean tv)
Sets the current instantiation according to the truth value tv


getCurrentInst

public int getCurrentInst()

initSampledVals

public void initSampledVals(int size)
initializes sampledVals to an array of size 'size'


toggleCurrentInst

public void toggleCurrentInst()

unset

public void unset()
Resets the currentInst field to -1, i.e. node becomes un-instantiated