|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.knowceans.topics.cgen.MixNet
public class MixNet
represents a mixture network, a bipartite BN with variable nodes turned into edges and parameters and priors turned into nodes.
Nested Class Summary | |
---|---|
class |
MixNet.Traversal
traverses the mixnet, calling delegates for each element type |
Field Summary | |
---|---|
(package private) java.util.Map<java.lang.String,java.lang.String> |
constants
|
(package private) java.util.List<MixEdge> |
edges
|
(package private) java.util.List<MixNode> |
nodes
|
(package private) java.util.List<MixSequence> |
sequences
|
static boolean |
verbose
|
Constructor Summary | |
---|---|
MixNet(java.lang.String name)
|
Method Summary | |
---|---|
void |
addItem(MixItem item)
add a node or edge |
boolean |
compile(java.io.PrintStream out)
compile the node indicators |
void |
coupleNodes(java.lang.String nodes)
couples the parameters of the nodes together in a C5 structure. |
java.lang.String |
getDescription()
|
MixEdge |
getEdge(java.lang.String query)
get edge by name or variable name |
java.util.List<MixEdge> |
getHiddenEdges()
|
java.util.List<MixNode> |
getHiddenNodes()
|
java.lang.String |
getName()
|
MixNode |
getNode(java.lang.String query)
get node by name or parameter name |
MixEdge |
getParentEdge(MixNode n,
java.lang.String ename)
get the parent edge for this ename (variable) or null |
java.util.List<MixEdge> |
getTypedEdges(int type)
get the edges matching ANY of the type's bits |
java.util.List<MixNode> |
getTypedNodes(int type)
get the nodes matching ANY of the bits in the type mask |
void |
linkItems(MixNode parent,
MixEdge edge,
MixNode child)
Add the node to |
void |
linkItems(java.lang.String parent,
java.lang.String child)
Link two mixnet items, assuming they are already added. |
void |
linkItems(java.lang.String parent,
java.lang.String edge,
java.lang.String child)
Add the node to |
java.util.List<java.lang.String> |
listInternalVars()
|
java.lang.String |
printSpecification()
print the specification of this network, as it may be parsed by MixNetParser. |
void |
setDescription(java.lang.String description)
|
java.lang.String |
toString()
|
java.util.List<MixItem> |
traverse()
|
java.util.List<MixItem> |
traverseForest(java.util.List<? extends MixItem> roots)
traverse mixture network = non-recursive forest depth-first search |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static boolean verbose
java.util.List<MixNode> nodes
java.util.List<MixEdge> edges
java.util.List<MixSequence> sequences
java.util.Map<java.lang.String,java.lang.String> constants
Constructor Detail |
---|
public MixNet(java.lang.String name)
Method Detail |
---|
public java.util.List<MixEdge> getTypedEdges(int type)
type
-
public java.util.List<MixNode> getTypedNodes(int type)
type
-
public java.util.List<MixEdge> getHiddenEdges()
public java.util.List<MixNode> getHiddenNodes()
public void addItem(MixItem item)
item
- public void linkItems(java.lang.String parent, java.lang.String child)
parent
- child
- public void linkItems(MixNode parent, MixEdge edge, MixNode child)
parent
- (null for root)edge
- variable (added repeatedly for coupled or merged edges in E3
and C3 structures)child
- (null for visible)public void linkItems(java.lang.String parent, java.lang.String edge, java.lang.String child)
parent
- (null for root)edge
- variable (added repeatedly for coupled or merged edges in E3
and C3 structures)child
- (null for visible)public void coupleNodes(java.lang.String nodes)
nodes
- comma-separated list of node parameter namespublic MixNode getNode(java.lang.String query)
query
-
public MixEdge getEdge(java.lang.String query)
query
-
public MixEdge getParentEdge(MixNode n, java.lang.String ename)
n
- ename
-
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String printSpecification()
TODO: add preferences.
public java.util.List<java.lang.String> listInternalVars()
public java.util.List<MixItem> traverse()
public java.util.List<MixItem> traverseForest(java.util.List<? extends MixItem> roots)
public boolean compile(java.io.PrintStream out)
public java.lang.String getName()
public java.lang.String getDescription()
public void setDescription(java.lang.String description)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |