|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object pt.tumba.ngram.bayes.BayesNet
public class BayesNet
Field Summary | |
---|---|
static int |
BIF
|
static int |
BUGS
|
static int |
INVALID_INDEX
|
protected java.lang.String |
name
|
protected ProbabilityFunction[] |
probability_functions
|
protected ProbabilityVariable[] |
probability_variables
|
protected java.util.Vector |
properties
|
protected DiscreteFunction |
utility_function
|
static int |
XML
|
Constructor Summary | |
---|---|
BayesNet()
Default constructor for a BayesNet. |
|
BayesNet(BayesNet bn)
Simple constructor for a BayesNet; creates a copy of a given network. |
|
BayesNet(java.io.InputStream istream)
Construct a BayesNet from a textual description in a stream. |
|
BayesNet(java.lang.String s)
Construct a BayesNet from a textual description in a string. |
|
BayesNet(java.lang.String n_n,
int n_v,
int n_f)
Simple constructor for a BayesNet. |
|
BayesNet(java.lang.String n_n,
java.util.Vector p)
Simple constructor for a BayesNet. |
|
BayesNet(java.net.URL url)
Construct a BayesNet from a textual description in an URL. |
|
BayesNet(java.net.URL context,
java.lang.String spec)
Construct a BayesNet from a textual description in an URL. |
Method Summary | |
---|---|
void |
add_property(java.lang.String prop)
Add a property. |
java.lang.String[][] |
get_all_evidence()
Get all the evidence contained in the network variables. |
ProbabilityFunction |
get_function(ProbabilityVariable p_v)
Find the ProbabilityFunction that corresponds to a given ProbabilityVariable. |
java.lang.String |
get_name()
Get the name of the network. |
ProbabilityFunction |
get_probability_function(int index)
Get the probability function at a given index. |
ProbabilityFunction[] |
get_probability_functions()
Get the probability functions. |
ProbabilityVariable |
get_probability_variable(int index)
Get the probability variable at a given index. |
ProbabilityVariable[] |
get_probability_variables()
Get the probability variables. |
java.util.Vector |
get_properties()
Get the properties. |
DiscreteFunction |
get_utility_function()
Get the utility function. |
int |
index_of_variable(java.lang.String n_vb)
Determine the position of a variable given its name. |
int |
number_probability_functions()
Get the number of distributions in the network. |
int |
number_variables()
Get the number of variables in the network. |
void |
print()
Print a BayesNet in the standard output. |
void |
print(java.io.PrintStream out)
Print a BayesNet in a given stream. |
protected void |
process_probability_function_properties(int index)
|
protected void |
process_probability_variable_properties(int index)
|
protected void |
process_properties()
|
void |
remove_property(int i)
Remove a property. |
void |
remove_property(java.lang.String prop)
Remove a property. |
void |
save_bif(java.io.PrintStream out)
Save a BayesNet object in a stream, in the BIF InterchangeFormat. |
void |
save_bugs(java.io.PrintStream pstream)
Save a BayesNet object into a stream, in the BUGS format. |
void |
save_embayes(java.io.PrintStream out)
Save a BayesNet object in a stream for the EBayes engine. |
void |
save_xml_0_2(java.io.PrintStream pstream)
Save a BayesNet object in a stream, in the XMLBIF format version 0.2. |
void |
save_xml(java.io.PrintStream pstream)
Save a BayesNet object in a stream, in the XMLBIF format version 0.3 (most recent version). |
void |
set_name(java.lang.String n)
Set the name of the network. |
void |
set_probability_function(int index,
ProbabilityFunction p_f)
Set a probability variable given its index. |
void |
set_probability_function(int index,
ProbabilityVariable[] variables,
double[] values,
java.util.Vector vec)
Set a probability function given its constituents. |
void |
set_probability_functions(ProbabilityFunction[] pfs)
Set the vector of probability functions. |
void |
set_probability_variable(int index,
ProbabilityVariable p_v)
Set a probability variable given its index. |
void |
set_probability_variable(int index,
java.lang.String name,
java.lang.String[] v,
java.util.Vector vec)
Set a probability variable given its constituents. |
void |
set_probability_variables(ProbabilityVariable[] pvs)
Set the vector of probability variables. |
void |
set_properties(java.util.Vector prop)
Set the properties. |
protected void |
translate(InterchangeFormat ifo)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String name
protected java.util.Vector properties
protected ProbabilityVariable[] probability_variables
protected ProbabilityFunction[] probability_functions
protected DiscreteFunction utility_function
public static final int INVALID_INDEX
public static final int BIF
public static final int XML
public static final int BUGS
Constructor Detail |
---|
public BayesNet()
public BayesNet(java.lang.String n_n, int n_v, int n_f)
n_n
- Name of the network.n_v
- Number of variables in the network.n_f
- Number of probability distributions in the network.public BayesNet(java.lang.String n_n, java.util.Vector p)
n_n
- Name of network.p
- Properties of the network.public BayesNet(BayesNet bn)
bn
- Network to be copied.public BayesNet(java.lang.String s) throws IFException
IFException
public BayesNet(java.io.InputStream istream) throws IFException
IFException
public BayesNet(java.net.URL context, java.lang.String spec) throws IFException, java.io.IOException
context
- The URL context as defined in the Java libraries.spec
- The URL spec as defined in the Java libraries.
IFException
java.io.IOException
public BayesNet(java.net.URL url) throws IFException, java.io.IOException
IFException
java.io.IOException
Method Detail |
---|
protected void translate(InterchangeFormat ifo)
protected void process_properties()
protected void process_probability_variable_properties(int index)
protected void process_probability_function_properties(int index)
public ProbabilityFunction get_function(ProbabilityVariable p_v)
public void save_bif(java.io.PrintStream out)
public void save_embayes(java.io.PrintStream out)
public void save_xml(java.io.PrintStream pstream)
public void save_xml_0_2(java.io.PrintStream pstream)
public void save_bugs(java.io.PrintStream pstream)
public java.lang.String[][] get_all_evidence()
public int index_of_variable(java.lang.String n_vb)
public void print()
public void print(java.io.PrintStream out)
public java.lang.String get_name()
public void set_name(java.lang.String n)
public java.util.Vector get_properties()
public void set_properties(java.util.Vector prop)
public void add_property(java.lang.String prop)
public void remove_property(java.lang.String prop)
public void remove_property(int i)
public int number_variables()
public int number_probability_functions()
public ProbabilityVariable get_probability_variable(int index)
public ProbabilityFunction get_probability_function(int index)
public ProbabilityVariable[] get_probability_variables()
public ProbabilityFunction[] get_probability_functions()
public DiscreteFunction get_utility_function()
public void set_probability_variable(int index, java.lang.String name, java.lang.String[] v, java.util.Vector vec)
public void set_probability_function(int index, ProbabilityVariable[] variables, double[] values, java.util.Vector vec)
public void set_probability_variable(int index, ProbabilityVariable p_v)
public void set_probability_function(int index, ProbabilityFunction p_f)
public void set_probability_variables(ProbabilityVariable[] pvs)
public void set_probability_functions(ProbabilityFunction[] pfs)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |