|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--bbn.NodeManager
Title: NodeManager.java Description: Core Bayesian Network class Copyright: Copyright (c) 2001 Company: KSU / KDD
| Field Summary | |
protected java.io.BufferedReader |
bufferedReader
|
| Constructor Summary | |
NodeManager(BBN newNetwork)
NodeManager constructs and initializes the Node Manager. |
|
| Method Summary | |
double |
getAttributeValue(int nodeIndex,
int attributeIndex)
|
java.util.Vector |
getEvidenceBits()
|
java.util.Vector |
getEvidenceNodeNames()
|
java.util.Vector |
getEvidenceNodes()
getEvidenceNodes returns a vector of Node objects containing all of the nodes that are evidence nodes. |
double |
getEvidenceSetProbability()
getStateSetProbability returns the probability of an instantiation by using the chain rule. |
java.util.Vector |
getEvidenceValues()
getEvidenceValues returns the instantiation of nodes in the evidence file |
BBN |
getNetwork()
|
java.util.Vector |
getNodeNames()
|
java.util.Vector |
getNodePercenteges()
|
double |
getProbabilityOfNodeGivenParents(Node node)
getProbabilityOfNodeGivenParents returns the probability of a certain node given the state of its parents. |
double |
getProbabilityOfNodeGivenParents(Node node,
boolean ignoreEvidence)
|
java.util.Vector |
getQueryNodeNames()
getQueryNodeNames return a vector of Strings containing all of the names of nodes that are query nodes. |
java.util.Vector |
getQueryNodes()
getQueryNodes returns a vector of Node objects containing all of the nodes that are query nodes. |
double |
getStateSetProbability()
getStateSetProbability returns the probability of an instantiation by using the chain rule. |
int |
getValue(int index)
getValue returns the requested node's current state. |
int |
getValue(Node node)
getValue returns the requested node's current state. |
int |
getValue(java.lang.String nodeName)
getValue returns the requested node's current state. |
boolean |
hasMoreLines()
hasMoreLines determines if there is another state set to read. |
boolean |
isEvidence(int index)
isEvidence returns true if the requested node index is an evidence. |
boolean |
isEvidence(Node node)
isEvidence returns true if the requested node is an evidence. |
boolean |
isEvidence(java.lang.String nodeName)
isEvidence returns true if the requested node name is an evidence. |
void |
loadEvidenceAtLine(int i)
loadEvidenceAtLine loads the instantiation from the evidence file at the given line |
boolean |
openEvidenceFile(java.lang.String fileName)
openEvidenceFile opens an evidence file, reads the structure of the file, and initializes the node manager layout. |
boolean |
readNextValues()
readNextValues reads the next state set from the file. |
java.lang.String |
report()
|
java.lang.String |
reportProbabilities()
|
java.lang.String |
reportSimpleValues()
|
java.util.Vector |
reportSimpleVector()
|
void |
resetValues()
|
void |
setAttributeValue(int nodeIndex,
int attributeIndex,
java.lang.Double value)
|
void |
setEvidenceBitvector(java.util.Vector bits)
|
void |
setNetwork(BBN network)
|
void |
setValue(int node,
int newState)
|
void |
setValue(Node node,
int newState)
|
void |
setValues(java.util.Vector newStates)
Sets node states to the given values. |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
protected java.io.BufferedReader bufferedReader
| Constructor Detail |
public NodeManager(BBN newNetwork)
newNetwork - - the host bayesian network for which the manager works.| Method Detail |
public boolean openEvidenceFile(java.lang.String fileName)
fileName - - the name of the evidence file to openpublic java.util.Vector getEvidenceValues()
public java.util.Vector getNodeNames()
public java.util.Vector getEvidenceBits()
public java.util.Vector getEvidenceNodeNames()
public void setNetwork(BBN network)
public void setEvidenceBitvector(java.util.Vector bits)
bits - - a vector of Integer objects - 0 or 1.public BBN getNetwork()
public void loadEvidenceAtLine(int i)
i - - the line in the evidence file to loadpublic boolean hasMoreLines()
public void resetValues()
public boolean readNextValues()
public boolean isEvidence(Node node)
node - - the node being queriedpublic boolean isEvidence(int index)
index - - the index being queriedpublic boolean isEvidence(java.lang.String nodeName)
nodeName - - the node being queriedpublic int getValue(int index)
index - - the node index being queriedpublic int getValue(java.lang.String nodeName)
nodeName - - the node being queriedpublic int getValue(Node node)
nodeName - - the node being queried
public void setValue(Node node,
int newState)
public void setValue(int node,
int newState)
public void setValues(java.util.Vector newStates)
newStates - - the new states being set.public java.util.Vector getQueryNodeNames()
public java.util.Vector getQueryNodes()
public java.util.Vector getEvidenceNodes()
public double getProbabilityOfNodeGivenParents(Node node)
node - - the node being queried.
public double getProbabilityOfNodeGivenParents(Node node,
boolean ignoreEvidence)
public double getStateSetProbability()
public double getEvidenceSetProbability()
public java.lang.String report()
public java.lang.String reportProbabilities()
public java.lang.String reportSimpleValues()
public java.util.Vector reportSimpleVector()
public void setAttributeValue(int nodeIndex,
int attributeIndex,
java.lang.Double value)
public double getAttributeValue(int nodeIndex,
int attributeIndex)
public java.util.Vector getNodePercenteges()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||