BayesianNetworks
Class DiscreteVariable

java.lang.Object
  |
  +--BayesianNetworks.DiscreteVariable

public class DiscreteVariable
extends java.lang.Object


Field Summary
protected  BayesNet bn
           
static int CHANCE
           
static int DECISION
           
protected  int explanation_index
           
protected  int index
           
protected  java.lang.String name
           
protected  int observed_index
           
static int TRANSPARENT
           
protected  int type
           
static int UTILITY
           
protected  java.lang.String[] values
           
 
Constructor Summary
DiscreteVariable(java.lang.String n, int t, java.lang.String[] vs)
          Constructor for a DiscreteVariable.
 
Method Summary
 int get_explanation_index()
          Get the index of the assigned value in the variable.
 int get_index()
          Get the index of the current DiscreteVariable.
 java.lang.String get_name()
          Get the name of the current DiscreteVariable.
 DiscreteFunction get_numeric_values()
          Produce an array of numeric values for the values of a variable.
 int get_observed_index()
          Get the index of the observed value.
 int get_type()
          Get the type of the DiscreteVariable.
 java.lang.String get_value(int i)
          Get a value of the current DiscreteVariable.
 java.lang.String[] get_values()
          Get the values of the current DiscreteVariable.
 int index_of_value(java.lang.String value)
          Determine the index of a value given its name; returns INVALID_INDEX if there is no index.
 boolean is_explanation()
          Indicate whether the current DiscreteVariable is an explanatory variable or not.
 boolean is_observed()
          Indicate whether the current DiscreteVariable has been observed or not.
 int number_values()
          Return the number of values in the current DiscreteVariable.
 void set_explanation_index(int i)
          Set the variable as explanatory with a given value.
 void set_index(int ind)
          Set the index of the variable.
 void set_invalid_index()
          Set the index of the current DiscreteVariable as invalid.
 void set_invalid_observed_index()
          Set the DiscreteVariable as not observed..
 void set_name(java.lang.String n)
          Set the name of the current DiscreteVariable.
 void set_observed_value(java.lang.String v)
          Set a value of the current DiscreteVariable as observed.
 void set_type(int t)
          Set the type of the current DiscreteVariable.
 void set_values(java.lang.String[] vals)
          Set the values of the current DiscreteVariable.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bn

protected BayesNet bn

name

protected java.lang.String name

index

protected int index

values

protected java.lang.String[] values

type

protected int type

observed_index

protected int observed_index

explanation_index

protected int explanation_index

CHANCE

public static final int CHANCE

TRANSPARENT

public static final int TRANSPARENT

DECISION

public static final int DECISION

UTILITY

public static final int UTILITY
Constructor Detail

DiscreteVariable

public DiscreteVariable(java.lang.String n,
                        int t,
                        java.lang.String[] vs)
Constructor for a DiscreteVariable.
Method Detail

index_of_value

public int index_of_value(java.lang.String value)
Determine the index of a value given its name; returns INVALID_INDEX if there is no index.

get_numeric_values

public DiscreteFunction get_numeric_values()
Produce an array of numeric values for the values of a variable. The values are direct translation of the string values into doubles; if the translation fails for a particular value, that value is replaced by its index.

get_name

public java.lang.String get_name()
Get the name of the current DiscreteVariable.

set_name

public void set_name(java.lang.String n)
Set the name of the current DiscreteVariable.

get_index

public int get_index()
Get the index of the current DiscreteVariable.

number_values

public int number_values()
Return the number of values in the current DiscreteVariable.

get_values

public java.lang.String[] get_values()
Get the values of the current DiscreteVariable.

set_values

public void set_values(java.lang.String[] vals)
Set the values of the current DiscreteVariable.

get_value

public java.lang.String get_value(int i)
Get a value of the current DiscreteVariable.
Parameters:
i - Position of the value in the array of values.

get_type

public int get_type()
Get the type of the DiscreteVariable.

is_explanation

public boolean is_explanation()
Indicate whether the current DiscreteVariable is an explanatory variable or not.

is_observed

public boolean is_observed()
Indicate whether the current DiscreteVariable has been observed or not.

set_observed_value

public void set_observed_value(java.lang.String v)
Set a value of the current DiscreteVariable as observed.
Parameters:
v - Observed value.

set_explanation_index

public void set_explanation_index(int i)
Set the variable as explanatory with a given value.
Parameters:
i - Index of the value that is assigned to the variable.

get_observed_index

public int get_observed_index()
Get the index of the observed value.

get_explanation_index

public int get_explanation_index()
Get the index of the assigned value in the variable.

set_index

public void set_index(int ind)
Set the index of the variable.

set_invalid_index

public void set_invalid_index()
Set the index of the current DiscreteVariable as invalid.

set_invalid_observed_index

public void set_invalid_observed_index()
Set the DiscreteVariable as not observed..

set_type

public void set_type(int t)
Set the type of the current DiscreteVariable.