edu.ucla.belief.decision
Class DecisionTreeImpl

Object
  extended by AbstractDirectedGraph
      extended by DecisionTreeImpl
All Implemented Interfaces:
DecisionListener, DecisionTree, Factory, DirectedGraph, Cloneable, Iterable, Collection

public class DecisionTreeImpl
extends AbstractDirectedGraph
implements DecisionTree, Factory, DecisionListener, DirectedGraph

Since:
120804
Author:
Keith Cascio

Field Summary
 
Fields inherited from class AbstractDirectedGraph
STREAM_DEBUG
 
Constructor Summary
DecisionTreeImpl(DecisionNode root)
           
DecisionTreeImpl(TableIndex index)
           
 
Method Summary
 void addHistory(DecisionInternal internal)
           
 void addHistory(DecisionLeaf leaf)
           
 void addListener(DecisionListener listener)
          interface DecisionTree
 void adopt(DecisionNode node)
          interface Factory
 void clear()
          interface Collection
 Object clone()
          interface DirectedGraph
 DecisionNode clone(DecisionNode node)
          interface Factory
 Parameter clone(Parameter parameter)
          interface Factory
 boolean contains(Object vertex)
          interface DirectedGraph
 void decisionEvent(DecisionEvent e)
          interface DecisionListener
 void ensureSnapshot()
          interface DecisionTree
 Table expand()
          interface DecisionTree
 DecisionLeaf getDefault()
          interface Factory
 TableIndex getIndex()
          interface DecisionTree
 Collection getInternalHistory()
          interface Factory
 DecisionLeaf getLeaf(DecisionNode node, int[] instantiation)
           
 DecisionLeaf getLeaf(int[] indices)
          interface DecisionTree
 Collection getLeafHistory()
          interface Factory
 double getParameter(int[] indices)
          interface DecisionTree
 Collection getParameterHistory()
          interface Factory
 DecisionNode getRoot()
          interface DecisionTree
 DecisionBackup getSnapshot()
          interface DecisionTree
 Set inComing(Object vertex)
          interface DirectedGraph
 void initRoot(DecisionNode root)
           
 DecisionInternal internalForID(String id)
          interface Factory
 boolean isUniqueNodeID(String id)
          interface Factory
 boolean isUniqueParameterID(String id)
          interface Factory
 boolean isValidID(String id)
          interface Factory
 DecisionLeaf leafForID(String id)
          interface Factory
 DecisionInternal newInternal(FiniteVariable var)
          interface Factory
 DecisionLeaf newLeaf(FiniteVariable var)
          interface Factory
 DecisionLeaf newLeaf(FiniteVariable var, Parameter[] params)
          interface Factory
 Parameter newParameter(double value)
          interface Factory
 Parameter newParameter(String id, double value)
          interface Factory
 DecisionNode nodeForID(String id)
          interface Factory
 void normalize()
          interface DecisionTree
 void noteOptimizationEpsilon(double epsilon)
           
 Set outGoing(Object vertex)
          interface DirectedGraph
 Parameter parameterForID(String id)
          interface Factory
 double recallOptimizationEpsilon()
           
 boolean removeHistory(DecisionLeaf leaf)
          interface Factory
 void removeHistoryAllDescendants(DecisionNode oldRoot)
           
 boolean removeListener(DecisionListener listener)
          interface DecisionTree
 boolean restoreSnapshot()
          interface DecisionTree
 void setSnapshot(DecisionBackup snaoshot)
          interface DecisionTree
 void snapshot()
          interface DecisionTree
 
Methods inherited from class AbstractDirectedGraph
add, addAll, addEdge, addVertex, containsAll, containsEdge, degree, depthFirstIterator, hasPath, inDegree, isAcyclic, isEmpty, isSinglyConnected, isWeaklyConnected, isWeaklyConnected, iterator, maintainsAcyclicity, numEdges, outDegree, remove, removeAll, removeEdge, removeVertex, replaceVertex, replaceVertices, retainAll, size, toArray, toArray, topologicalOrder, vertices
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface DirectedGraph
addEdge, addVertex, containsEdge, degree, hasPath, inDegree, isAcyclic, isSinglyConnected, isWeaklyConnected, isWeaklyConnected, maintainsAcyclicity, numEdges, outDegree, removeEdge, removeVertex, replaceVertex, replaceVertices, size, topologicalOrder, vertices
 
Methods inherited from interface Collection
add, addAll, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, toArray, toArray
 

Constructor Detail

DecisionTreeImpl

public DecisionTreeImpl(TableIndex index)

DecisionTreeImpl

public DecisionTreeImpl(DecisionNode root)
Method Detail

noteOptimizationEpsilon

public void noteOptimizationEpsilon(double epsilon)
Since:
011605

recallOptimizationEpsilon

public double recallOptimizationEpsilon()
Since:
011605

snapshot

public void snapshot()
interface DecisionTree

Specified by:
snapshot in interface DecisionTree

restoreSnapshot

public boolean restoreSnapshot()
interface DecisionTree

Specified by:
restoreSnapshot in interface DecisionTree

ensureSnapshot

public void ensureSnapshot()
interface DecisionTree

Specified by:
ensureSnapshot in interface DecisionTree

getSnapshot

public DecisionBackup getSnapshot()
interface DecisionTree

Specified by:
getSnapshot in interface DecisionTree

setSnapshot

public void setSnapshot(DecisionBackup snaoshot)
interface DecisionTree

Specified by:
setSnapshot in interface DecisionTree

normalize

public void normalize()
interface DecisionTree

Specified by:
normalize in interface DecisionTree

getRoot

public DecisionNode getRoot()
interface DecisionTree

Specified by:
getRoot in interface DecisionTree

getIndex

public TableIndex getIndex()
interface DecisionTree

Specified by:
getIndex in interface DecisionTree

expand

public Table expand()
interface DecisionTree

Specified by:
expand in interface DecisionTree

getLeaf

public DecisionLeaf getLeaf(int[] indices)
interface DecisionTree

Specified by:
getLeaf in interface DecisionTree
Since:
011405

getLeaf

public DecisionLeaf getLeaf(DecisionNode node,
                            int[] instantiation)
Since:
011405

addListener

public void addListener(DecisionListener listener)
interface DecisionTree

Specified by:
addListener in interface DecisionTree

removeListener

public boolean removeListener(DecisionListener listener)
interface DecisionTree

Specified by:
removeListener in interface DecisionTree

decisionEvent

public void decisionEvent(DecisionEvent e)
interface DecisionListener

Specified by:
decisionEvent in interface DecisionListener

initRoot

public void initRoot(DecisionNode root)

getParameter

public double getParameter(int[] indices)
interface DecisionTree

Specified by:
getParameter in interface DecisionTree

clear

public void clear()
interface Collection

Specified by:
clear in interface Collection

clone

public Object clone()
interface DirectedGraph

Specified by:
clone in interface DirectedGraph
Specified by:
clone in class AbstractDirectedGraph

inComing

public Set inComing(Object vertex)
interface DirectedGraph

Specified by:
inComing in interface DirectedGraph
Returns:
Iterator over the vertices adjacent to edges entering vertex.

outGoing

public Set outGoing(Object vertex)
interface DirectedGraph

Specified by:
outGoing in interface DirectedGraph
Returns:
Iterator over the vertices adjacent to edges leaving vertex.

contains

public boolean contains(Object vertex)
interface DirectedGraph

Specified by:
contains in interface DirectedGraph
Specified by:
contains in interface Collection
Returns:
true if vertex is in the graph(tested by "equals"), false otherwise.

newParameter

public Parameter newParameter(double value)
interface Factory

Specified by:
newParameter in interface Factory

newParameter

public Parameter newParameter(String id,
                              double value)
interface Factory

Specified by:
newParameter in interface Factory

clone

public Parameter clone(Parameter parameter)
interface Factory

Specified by:
clone in interface Factory

clone

public DecisionNode clone(DecisionNode node)
interface Factory

Specified by:
clone in interface Factory

getParameterHistory

public Collection getParameterHistory()
interface Factory

Specified by:
getParameterHistory in interface Factory

getDefault

public DecisionLeaf getDefault()
interface Factory

Specified by:
getDefault in interface Factory

newLeaf

public DecisionLeaf newLeaf(FiniteVariable var)
interface Factory

Specified by:
newLeaf in interface Factory

newLeaf

public DecisionLeaf newLeaf(FiniteVariable var,
                            Parameter[] params)
interface Factory

Specified by:
newLeaf in interface Factory

removeHistory

public boolean removeHistory(DecisionLeaf leaf)
interface Factory

Specified by:
removeHistory in interface Factory

adopt

public void adopt(DecisionNode node)
interface Factory

Specified by:
adopt in interface Factory

addHistory

public void addHistory(DecisionLeaf leaf)

addHistory

public void addHistory(DecisionInternal internal)

getLeafHistory

public Collection getLeafHistory()
interface Factory

Specified by:
getLeafHistory in interface Factory

newInternal

public DecisionInternal newInternal(FiniteVariable var)
interface Factory

Specified by:
newInternal in interface Factory

getInternalHistory

public Collection getInternalHistory()
interface Factory

Specified by:
getInternalHistory in interface Factory

isUniqueNodeID

public boolean isUniqueNodeID(String id)
interface Factory

Specified by:
isUniqueNodeID in interface Factory

isUniqueParameterID

public boolean isUniqueParameterID(String id)
interface Factory

Specified by:
isUniqueParameterID in interface Factory

isValidID

public boolean isValidID(String id)
interface Factory

Specified by:
isValidID in interface Factory

parameterForID

public Parameter parameterForID(String id)
interface Factory

Specified by:
parameterForID in interface Factory

leafForID

public DecisionLeaf leafForID(String id)
interface Factory

Specified by:
leafForID in interface Factory

internalForID

public DecisionInternal internalForID(String id)
interface Factory

Specified by:
internalForID in interface Factory

nodeForID

public DecisionNode nodeForID(String id)
interface Factory

Specified by:
nodeForID in interface Factory

removeHistoryAllDescendants

public void removeHistoryAllDescendants(DecisionNode oldRoot)


Copyright 2010 UCLA Automated Reasoning Group