Class Variable

java.lang.Object
  extended by Variable

public class Variable
extends java.lang.Object

A variable in a Bayesian network.


Field Summary
private  int evidence
          The index of an outcome that were observed as an evidence.
private  int id
          ID of the variable
private  java.lang.String name
          Original variable name in the XML specification.
private  int order
          The position of the variable in the total (topological) order.
private  double[] origTable
          Original CPT.
private  java.util.List<java.lang.String> outcomeList
          Original names of the outcomes in the XML specification.
private  java.util.List<java.lang.Integer> parentList
          List of IDs of parent variables.
private  double[] table
          CPT.
 
Constructor Summary
Variable()
          Create a BN variable with no operation.
 
Method Summary
 void addOutcome(java.lang.String o)
           
 void addParent(int id)
           
 int getEvidence()
           
 int getId()
           
 java.lang.String getName()
           
 int getOrder()
           
 java.util.List<java.lang.String> getOutcomeList()
           
 int getOutcomeSize()
           
 java.util.List<java.lang.Integer> getParentList()
           
 double[] getTable()
           
 void replaceRandomTable()
          Replaces the original CPT with a randomly generated one.
 void setEvidence(int e)
           
 void setId(int i)
           
 void setName(java.lang.String n)
           
 void setOrder(int o)
           
 void setOutcomeList(java.util.List<java.lang.String> l)
           
 void setParentList(java.util.List<java.lang.Integer> l)
           
 void setTable(double[] t)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

private java.lang.String name
Original variable name in the XML specification.


id

private int id
ID of the variable


outcomeList

private java.util.List<java.lang.String> outcomeList
Original names of the outcomes in the XML specification.


parentList

private java.util.List<java.lang.Integer> parentList
List of IDs of parent variables.


table

private double[] table
CPT.


origTable

private double[] origTable
Original CPT.


order

private int order
The position of the variable in the total (topological) order.


evidence

private int evidence
The index of an outcome that were observed as an evidence.

Constructor Detail

Variable

public Variable()
Create a BN variable with no operation.

Method Detail

setName

public void setName(java.lang.String n)

setId

public void setId(int i)

setOrder

public void setOrder(int o)

setParentList

public void setParentList(java.util.List<java.lang.Integer> l)

setEvidence

public void setEvidence(int e)

setOutcomeList

public void setOutcomeList(java.util.List<java.lang.String> l)

getName

public java.lang.String getName()

getId

public int getId()

getOrder

public int getOrder()

getParentList

public java.util.List<java.lang.Integer> getParentList()

getEvidence

public int getEvidence()

getOutcomeList

public java.util.List<java.lang.String> getOutcomeList()

getOutcomeSize

public int getOutcomeSize()

addParent

public void addParent(int id)

addOutcome

public void addOutcome(java.lang.String o)

setTable

public void setTable(double[] t)

getTable

public double[] getTable()

replaceRandomTable

public void replaceRandomTable()
Replaces the original CPT with a randomly generated one.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object