edu.ucla.belief.recursiveconditioning
Class RCDtree

Object
  extended by RC
      extended by RCDtree
All Implemented Interfaces:
KnowledgeBase.KnowledgeBaseListener

public final class RCDtree
extends RC

This class represents "compiled" dtree objects used in recursive conditioning.

Author:
David Allen

Nested Class Summary
 
Nested classes/interfaces inherited from class RC
RC.RCCounters, RC.RCCreationException, RC.RCCreationParams, RC.RCStats, RC.RCStats_All, RC.RCStats_Pe, RC.RecCondThreadListener
 
Field Summary
 
Fields inherited from class RC
allowKB, counters, DEBUG_RC_CALC, DEBUG_RC_EVID, DOUBLE_OUTOFMEMORY, outputConsole, scalar, STR_EXCEPTION_EVIDENCE, STR_OUTOFMEMORY_MSG, STR_STACKOVERFLOW_MSG, TODO_REMOVE_DO_EXTRA_LOOKAHEAD, TODO_REMOVE_DO_INDEX_CACHING_DURING_CREATION, TODO_REMOVE_DO_LEAF_CACHING_DURING_CREATION, TODO_REMOVE_DO_LOOKAHEAD_LOWERBOUND, TODO_REMOVE_DO_PROP_UP, TODO_REMOVE_REVERSE_ORDER, vars
 
Constructor Summary
RCDtree(RC.RCCreationParams params)
          Warning: Using this constructor will not create the complete structure.
RCDtree(RC.RCCreationParams params, CachingScheme cs, CachingScheme.RCCreateListener listnr, DecompositionStructureUtils.ParamsTree crm_par)
          Creates a new RCDtree based on the parameters.
 
Method Summary
static Thread allocateRCDtreeInThread(RCDtree dt, CachingScheme cs, CachingScheme.RCCreateListener listnr, double seed_bestCost, Map seed_cf)
           
static Thread createRCDtreeInThread(RC.RCCreationParams params, CachingScheme cs, CachingScheme.RCCreateListener listnr, DecompositionStructureUtils.ParamsTree crm_par)
          This will create a thread in which an RCDtree will be created (by using the listnr parameter, the search for CacheSchemes can be monitored and stopped which will return the best result found so far (if the cachingScheme supports it).
 RCNode getAnyRoot()
           
 RCIterator getIteratorRoots()
           
 RCIteratorTraversal getIteratorTraversal()
           
 RCIterator getIteratorTree()
           
static String getStaticTagName()
           
 String getTagName()
           
 double[] recCond_All()
          Run Recursive conditioning P(e) for each root node (special for testing & output of timing/memory...).
 void recCond_PreCompute()
          Run RC for each root node to "precompute" the marginals.
 void setRoot(RCNode rt, boolean callInit)
           
 
Methods inherited from class RC
allContexts, allContextsMinusLeafs, allocRCCaches, allocRCMPE3Caches, allocRCMPE4Caches, allocRCMPECaches, assertLearnedPositive, assertUnLearnedPositive, canComputeFamilyMarginals, clearKB, collOfFinVarsToStateSpace, createKB, generateNumParents, getCFMap, getIterator, getIteratorParentChild, getRoots, getStatistics, getStatistics, getThreadRunning, getVars, getVars, isRunning, kbCallAssertOnVar, kbDontCallAssertOnVar, knowledgeBase, limitedContexts, numCacheEntries_MPE, numRoots, observe, parentChildOrdering, pauseRecCondAsThread, recCond_MPE, recCond_MPE3, recCond_MPE4, recCond_MPEAsThread, recCond_Pe_Scaled, recCond_Pe_ScaledAsThread, recCond_Pe, recCond_PeAsThread, resetEvidence, resetRC, resetStatistics, resumeKB, resumeRecCondAsThread, reSynchEvidWithBN, root, setCPT, setInst, statsAll, statsPe, stopAndWaitRecCondAsThread, suspendKB, toRealPr, toRealPr, unobserve, useKB, useKBflag, varToRoot
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RCDtree

public RCDtree(RC.RCCreationParams params)
Warning: Using this constructor will not create the complete structure. You must eventually call setRoot to finish creating and initializing it.


RCDtree

public RCDtree(RC.RCCreationParams params,
               CachingScheme cs,
               CachingScheme.RCCreateListener listnr,
               DecompositionStructureUtils.ParamsTree crm_par)
Creates a new RCDtree based on the parameters.

Parameters:
bn - A valid BeliefNetwork to use.
cs - A valid CachingScheme to use.
listnr - A Listener or else null.
scalar - Usually 1.0, but for genetics can scale it (slowing down computations).
useKB - Uses UnitResolution in a KnowledgeBase during computations.
includeMPE - If true, allows MPE calculations to be run on this dtree, otherwise they cannot.
Throws:
RCCreationException - if could not create a RCDtree.
Method Detail

setRoot

public void setRoot(RCNode rt,
                    boolean callInit)

allocateRCDtreeInThread

public static Thread allocateRCDtreeInThread(RCDtree dt,
                                             CachingScheme cs,
                                             CachingScheme.RCCreateListener listnr,
                                             double seed_bestCost,
                                             Map seed_cf)

createRCDtreeInThread

public static Thread createRCDtreeInThread(RC.RCCreationParams params,
                                           CachingScheme cs,
                                           CachingScheme.RCCreateListener listnr,
                                           DecompositionStructureUtils.ParamsTree crm_par)
This will create a thread in which an RCDtree will be created (by using the listnr parameter, the search for CacheSchemes can be monitored and stopped which will return the best result found so far (if the cachingScheme supports it).

It catches RCCreationException and will call rcCreateError() ------rcCreateDone(null) if that happens.


getIteratorRoots

public RCIterator getIteratorRoots()
Specified by:
getIteratorRoots in class RC

getIteratorTree

public RCIterator getIteratorTree()
Specified by:
getIteratorTree in class RC

getIteratorTraversal

public RCIteratorTraversal getIteratorTraversal()
Specified by:
getIteratorTraversal in class RC

getAnyRoot

public RCNode getAnyRoot()
Specified by:
getAnyRoot in class RC

recCond_PreCompute

public void recCond_PreCompute()
Description copied from class: RC
Run RC for each root node to "precompute" the marginals.

This is meant mostly for dgraphs, where the marginal is saved in the root. For a dtree, it will just fill up the caches, but not at the root node.

Note: It is possible for the returned value to be NaN if the network contains that in a cpt.

Specified by:
recCond_PreCompute in class RC

recCond_All

public double[] recCond_All()
Description copied from class: RC
Run Recursive conditioning P(e) for each root node (special for testing & output of timing/memory...).

Note: It is possible for the returned value to be NaN if the network contains that in a cpt.

Specified by:
recCond_All in class RC

getTagName

public String getTagName()
Specified by:
getTagName in class RC

getStaticTagName

public static String getStaticTagName()


Copyright 2010 UCLA Automated Reasoning Group