pt.tumba.ngram.bayes
Class InferenceGraphNode

java.lang.Object
  extended by pt.tumba.ngram.bayes.InferenceGraphNode

public class InferenceGraphNode
extends java.lang.Object


Field Summary
(package private)  java.util.Vector children
           
private  BayesNet defaultInferenceGraphNodeBayesNet
           
private  java.util.Vector defaultInferenceGraphNodeProperties
           
private  java.lang.String[] defaultInferenceGraphNodeValues
           
(package private)  InferenceGraph ig
           
(package private)  java.util.Vector parents
           
(package private)  ProbabilityFunction pf
           
(package private)  java.awt.Point pos
           
(package private)  ProbabilityVariable pv
           
 
Constructor Summary
InferenceGraphNode(InferenceGraph i_g, ProbabilityVariable p_v, ProbabilityFunction p_f)
           
InferenceGraphNode(InferenceGraph i_g, ProbabilityVariable p_v, ProbabilityFunction p_f, java.awt.Point position)
           
InferenceGraphNode(InferenceGraph i_g, java.lang.String name)
           
InferenceGraphNode(InferenceGraph i_g, java.lang.String name, java.awt.Point position)
           
 
Method Summary
 void add_function_property(java.lang.String prop)
          Add a property from to function.
 void add_variable_property(java.lang.String s)
          Add a property to a variable.
 void clear_observation()
          Clear the observation for the node.
 java.lang.String[] get_all_names()
          Get the name of all variables in the probability function.
 java.lang.String[][] get_all_values()
          Get all values for variables in the function in the node.
 java.util.Vector get_children()
          Return the children of a node as an Enumeration object.
 java.util.Vector get_function_properties()
          Return the function properties.
 double get_function_value(java.lang.String[][] variable_value_pairs, int index_extreme_point)
          Get a single value of the probability function in the node given a list of pairs (Variable Value).
 double[] get_function_values()
          Get an array containing probability values.
 double[] get_function_values(int index)
          Get an array containing probability values; if credal set, return the first extreme point.
 java.lang.String get_name()
          Return the name of the variable in the node.
 int get_number_values()
          Return the number of values in the variable in the node.
 int get_observed_value()
          Return the observed value for the variable in the node.
 java.util.Vector get_parents()
          Return the parents of a node as an Enumeration object.
 int get_pos_x()
          Return the X position of the node.
 int get_pos_y()
          Return the Y position of the node.
 java.lang.String[] get_values()
          Return the values of the variable in the node.
 java.util.Vector get_variable_properties()
          Return the variable properties
 boolean hasParent()
          Indicate whether the node has parents.
(package private)  void init_dists()
           
 boolean is_credal_set()
          Whether or not the node represents a convex set of distributions (credal set).
 boolean is_explanation()
          Indicate whether the variable in the node is an explanatory variable.
 boolean is_observed()
          Indicate whether the variable in the node is observed.
 int number_extreme_distributions()
          Number of distributions that are represented by a node.
private  java.awt.Point parse_position(ProbabilityVariable p_v)
           
 void remove_function_property(int index)
          Remove a property from a function.
 void remove_variable_property(int index)
          Remove a property from a variable.
 void set_explanation(boolean flag)
          Set the explanatory status of the node.
 void set_function_properties(java.util.Vector prop)
          Set the function properties.
 void set_function_value(java.lang.String[][] variable_value_pairs, double val, int index_extreme_point)
          Set a single value of the probability function in the node given a list of pairs (Variable Value).
 void set_function_values(double[] fv)
          Set an array containing probability values; if credal set, insert the array in the first extreme point.
 void set_function_values(int iep, double[] fv)
          Set an array containing an extreme point of the credal set.
 void set_local_credal_set()
          Make sure the node represents a VertexSet.
 void set_local_credal_set(int number_extreme_points)
          Make sure the node represents a VertexSet a given number of extreme distributions.
 void set_name(java.lang.String n)
          Set the name of the variable.
 void set_no_local_credal_set()
          Make sure the node represents a single distribution.
 void set_observation_value(java.lang.String value)
          Set the observation for the node.
 void set_variable_properties(java.util.Vector prop)
          Set the variable properties.
 void update_position_from_property(java.lang.String s)
           
(package private)  void update_position()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ig

InferenceGraph ig

pv

ProbabilityVariable pv

pf

ProbabilityFunction pf

parents

java.util.Vector parents

children

java.util.Vector children

pos

java.awt.Point pos

defaultInferenceGraphNodeValues

private final java.lang.String[] defaultInferenceGraphNodeValues

defaultInferenceGraphNodeBayesNet

private final BayesNet defaultInferenceGraphNodeBayesNet

defaultInferenceGraphNodeProperties

private final java.util.Vector defaultInferenceGraphNodeProperties
Constructor Detail

InferenceGraphNode

InferenceGraphNode(InferenceGraph i_g,
                   java.lang.String name)

InferenceGraphNode

InferenceGraphNode(InferenceGraph i_g,
                   java.lang.String name,
                   java.awt.Point position)

InferenceGraphNode

InferenceGraphNode(InferenceGraph i_g,
                   ProbabilityVariable p_v,
                   ProbabilityFunction p_f)

InferenceGraphNode

InferenceGraphNode(InferenceGraph i_g,
                   ProbabilityVariable p_v,
                   ProbabilityFunction p_f,
                   java.awt.Point position)
Method Detail

init_dists

void init_dists()

update_position

void update_position()

parse_position

private java.awt.Point parse_position(ProbabilityVariable p_v)

get_function_value

public double get_function_value(java.lang.String[][] variable_value_pairs,
                                 int index_extreme_point)
Get a single value of the probability function in the node given a list of pairs (Variable Value). The list specifies which element of the function is referred to.


get_function_values

public double[] get_function_values()
Get an array containing probability values.


get_function_values

public double[] get_function_values(int index)
Get an array containing probability values; if credal set, return the first extreme point.


set_function_values

public void set_function_values(double[] fv)
Set an array containing probability values; if credal set, insert the array in the first extreme point.


set_function_values

public void set_function_values(int iep,
                                double[] fv)
Set an array containing an extreme point of the credal set.


set_function_value

public void set_function_value(java.lang.String[][] variable_value_pairs,
                               double val,
                               int index_extreme_point)
Set a single value of the probability function in the node given a list of pairs (Variable Value). The list specifies which element of the function is referred to.


get_name

public java.lang.String get_name()
Return the name of the variable in the node.


set_name

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


get_all_names

public java.lang.String[] get_all_names()
Get the name of all variables in the probability function.


get_values

public java.lang.String[] get_values()
Return the values of the variable in the node.


get_all_values

public java.lang.String[][] get_all_values()
Get all values for variables in the function in the node.


get_number_values

public int get_number_values()
Return the number of values in the variable in the node.


hasParent

public boolean hasParent()
Indicate whether the node has parents.


get_parents

public java.util.Vector get_parents()
Return the parents of a node as an Enumeration object.


get_children

public java.util.Vector get_children()
Return the children of a node as an Enumeration object.


is_observed

public boolean is_observed()
Indicate whether the variable in the node is observed.


is_explanation

public boolean is_explanation()
Indicate whether the variable in the node is an explanatory variable.


get_observed_value

public int get_observed_value()
Return the observed value for the variable in the node.


get_pos_x

public int get_pos_x()
Return the X position of the node.


get_pos_y

public int get_pos_y()
Return the Y position of the node.


get_variable_properties

public java.util.Vector get_variable_properties()
Return the variable properties


set_variable_properties

public void set_variable_properties(java.util.Vector prop)
Set the variable properties.


get_function_properties

public java.util.Vector get_function_properties()
Return the function properties.


set_function_properties

public void set_function_properties(java.util.Vector prop)
Set the function properties.


is_credal_set

public boolean is_credal_set()
Whether or not the node represents a convex set of distributions (credal set).


number_extreme_distributions

public int number_extreme_distributions()
Number of distributions that are represented by a node.


set_no_local_credal_set

public void set_no_local_credal_set()
Make sure the node represents a single distribution.


set_local_credal_set

public void set_local_credal_set(int number_extreme_points)
Make sure the node represents a VertexSet a given number of extreme distributions.


set_local_credal_set

public void set_local_credal_set()
Make sure the node represents a VertexSet.


set_observation_value

public void set_observation_value(java.lang.String value)
Set the observation for the node.


clear_observation

public void clear_observation()
Clear the observation for the node.


set_explanation

public void set_explanation(boolean flag)
Set the explanatory status of the node.


remove_variable_property

public void remove_variable_property(int index)
Remove a property from a variable.


remove_function_property

public void remove_function_property(int index)
Remove a property from a function.


add_variable_property

public void add_variable_property(java.lang.String s)
Add a property to a variable.


update_position_from_property

public void update_position_from_property(java.lang.String s)

add_function_property

public void add_function_property(java.lang.String prop)
Add a property from to function.