|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
ObjectRC2
public final class RC2
This class represents Dtrees and Dgraphs.
setRoots may only be called once, future calls will cause an exception to be thrown.
Computations may be done by calls to compute_*.
Evidence can be changed through the following functions, however if you are using threads be careful: synchEvidWithBN, observe, unobserve
CPTs can be changed so long as the variables and their indexing remain the same (i.e. the only change allowed is parameter modifications). To do this, change the BeliefNetworks FiniteVariable.CPTShell and then call setCPT().
Nested Class Summary | |
---|---|
static interface |
RC2.CachingScheme
|
static class |
RC2.ComputationStats
|
static class |
RC2.RCCreationParams
|
static class |
RC2.StoredComputationStats
|
Field Summary | |
---|---|
KB_SAT |
kb_sat
|
KBMap.Mapping |
map_kb
|
PrintWriter |
outputConsole
|
long |
rcCallsCounter
|
double |
scalar
|
Constructor Summary | |
---|---|
RC2(RC2.RCCreationParams param)
An RC2 object should be created before any nodes are created, as it has to be passed into the node constructors. |
Method Summary | |
---|---|
void |
close()
This will clean up all resources used by RC (currently the SAT engine). |
RC2.StoredComputationStats |
compStats()
|
Table |
compute_CutMarginal(int rt)
If the root rt is a leaf node, it will return null. |
double |
compute_MPEValue()
Does not run with scaling enabled. |
Table |
compute_ParDer(int rt)
|
double |
compute_Pe_sat()
|
double |
compute_Pe()
This will return the scaled version if scaling is enabled, the caller is responsible for converting it, as that conversion could cause an underflow to occur. |
void |
flushCaches()
|
double |
getComputationTotalTime_ms()
|
ArrayList |
getElimOrder()
|
int |
getNumRCNodes_All()
Can use this and getRCNode_All to iterate through nodes. |
int |
getNumRCNodes_Pe()
Can use this and getRCNode_Pe to iterate through nodes. |
RC2Node |
getPeRootNode()
|
RC2Node |
getRCNode_All(int indx)
Can use this and getNumRCNodes_All to iterate through nodes. |
RC2Node |
getRCNode_Pe(int indx)
Can use this and getNumRCNodes_Pe to iterate through nodes. |
RC2Node[] |
getRootNodes()
|
void |
observe(FiniteVariable var,
Object value)
|
void |
outputInfo(String str)
|
void |
prePrepareToStartComputation()
Attempt to do some preparation steps before computations are actually run. |
void |
setCachingScheme(RC2.CachingScheme cs)
This function will set the caching in the RC2 object based on the caching scheme passed in, and will compute the current memory usage and expected RC calls based on the changes. |
void |
setCPT(FiniteVariable var,
boolean resetDeterminism)
Call this function after updating the CPTShell object for a FiniteVariable, however, RC2 can only handle parameter changes, the variables and their indexing must remain the same. |
void |
setRoots(RC2Node peNd,
RC2Node[] rts,
RC2Node[] pds,
RC2.CachingScheme cs)
Will set this objects root(s). |
void |
synchEvidWithBN()
|
void |
unobserve(FiniteVariable var)
|
List |
vars()
|
Methods inherited from class Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public PrintWriter outputConsole
public long rcCallsCounter
public final double scalar
public final KBMap.Mapping map_kb
public KB_SAT kb_sat
Constructor Detail |
---|
public RC2(RC2.RCCreationParams param)
Method Detail |
---|
public void close()
Any future calls using kb_sat after this will cause problems!
public void setRoots(RC2Node peNd, RC2Node[] rts, RC2Node[] pds, RC2.CachingScheme cs)
Copies of rts and pds are used by this RC object.
User is responsible for calling the initialize functions on these nodes BEFORE calling this function.
peNd is also allowed to be a member of rts, however it does not have to be.
peNd will be used for Pe, Pe_log, and MPE calculations.
public double compute_Pe_sat()
public double compute_Pe()
public double compute_MPEValue()
public Table compute_CutMarginal(int rt)
public Table compute_ParDer(int rt)
public void prePrepareToStartComputation()
public void setCachingScheme(RC2.CachingScheme cs)
public List vars()
public double getComputationTotalTime_ms()
public ArrayList getElimOrder()
public int getNumRCNodes_All()
public RC2Node getRCNode_All(int indx)
public int getNumRCNodes_Pe()
public RC2Node getRCNode_Pe(int indx)
public RC2Node getPeRootNode()
public RC2Node[] getRootNodes()
public RC2.StoredComputationStats compStats()
public void flushCaches()
public void synchEvidWithBN()
public final void observe(FiniteVariable var, Object value)
public final void unobserve(FiniteVariable var)
public final void setCPT(FiniteVariable var, boolean resetDeterminism)
public final void outputInfo(String str)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |