pt.tumba.ngram.bayes
Class VertexSet

java.lang.Object
  extended by pt.tumba.ngram.bayes.DiscreteFunction
      extended by pt.tumba.ngram.bayes.ProbabilityFunction
          extended by pt.tumba.ngram.bayes.QBProbabilityFunction
              extended by pt.tumba.ngram.bayes.FinitelyGeneratedSet
                  extended by pt.tumba.ngram.bayes.VertexSet
All Implemented Interfaces:
java.io.Serializable

public class VertexSet
extends FinitelyGeneratedSet

See Also:
Serialized Form

Field Summary
(package private)  ProbabilityVariable auxiliary_variable
           
(package private)  double[][] extreme_points
           
 
Fields inherited from class pt.tumba.ngram.bayes.QBProbabilityFunction
lower_envelope, upper_envelope
 
Fields inherited from class pt.tumba.ngram.bayes.ProbabilityFunction
bn, properties
 
Fields inherited from class pt.tumba.ngram.bayes.DiscreteFunction
values, variables
 
Constructor Summary
VertexSet(BayesNet b_n, ProbabilityVariable[] pvs, double[][] ep, java.util.Vector prop)
          Default constructor for a VertexQBProbabilityFunction.
VertexSet(BayesNet b_n, ProbabilityVariable[] pvs, double[] v, java.util.Vector prop, double[][] ep)
          Constructor for a VertexQBProbabilityFunction.
VertexSet(ProbabilityFunction pf)
          Constructor for a VertexQBProbabilityFunction.
VertexSet(ProbabilityFunction pf, double[] new_values)
          Constructor for a VertexQBProbabilityFunction from a ProbabilityFunction object and new values.
 
Method Summary
 void compose_values()
          Produce the centroid of all extreme distributions and insert it into the values of the distribution.
private  ProbabilityVariable create_auxiliary_variable(BayesNet transformed_bn)
          Create an auxiliar variable to indicate the vertices.
private  double[] create_new_values(BayesNet transformed_bn)
          Create a new array of values that combines extreme points.
 double evaluate(java.lang.String[][] variable_value_pairs, int index_extreme_point)
          Evaluate a function given a list of pairs (Variable Value) which specifies a value of the function, and the index of the extreme distribution to consider.
 ProbabilityVariable get_auxiliary_variable()
          Methods that allow basic manipulation of non-public variables.
 double[][] get_extreme_points()
           
 VertexSet prepare_auxiliary_variable(BayesNet transformed_bn)
          Put together all the values for the possible vertices of credal set and create an auxiliary variable to indicate which vertex to consider There are three things to do: 1) Create an auxiliary_variable with correct values.
 void print(java.io.PrintStream out)
          Print method.
 void set_extreme_point(int index, double[] ep)
          Set an extreme point of the credal set.
 void set_local_credal_set(int number_extreme_points)
          Set the number of extreme distributions in the credal set.
 void set_value(java.lang.String[][] variable_value_pairs, double val, int index_extreme_point)
          Set a single value of the probability function.
 
Methods inherited from class pt.tumba.ngram.bayes.QBProbabilityFunction
get_lower_envelope, get_upper_envelope, print
 
Methods inherited from class pt.tumba.ngram.bayes.ProbabilityFunction
add_property, evaluate, evaluate, expected_value, get_enumerated_properties, get_position_from_indexes, get_properties, posterior_expected_value, process_properties, remove_property, remove_property, save_xml_0_3, save_xml, set_properties, set_value, variance
 
Methods inherited from class pt.tumba.ngram.bayes.DiscreteFunction
evaluate, get_index, get_indexes, get_position_from_indexes, get_value, get_values, get_variable, get_variables, memberOf, multiply, normalize_first, normalize, number_values, number_variables, same_variables, set_value, set_values, set_variable, sum_out
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

auxiliary_variable

ProbabilityVariable auxiliary_variable

extreme_points

double[][] extreme_points
Constructor Detail

VertexSet

public VertexSet(BayesNet b_n,
                 ProbabilityVariable[] pvs,
                 double[][] ep,
                 java.util.Vector prop)
Default constructor for a VertexQBProbabilityFunction.


VertexSet

public VertexSet(BayesNet b_n,
                 ProbabilityVariable[] pvs,
                 double[] v,
                 java.util.Vector prop,
                 double[][] ep)
Constructor for a VertexQBProbabilityFunction.


VertexSet

public VertexSet(ProbabilityFunction pf)
Constructor for a VertexQBProbabilityFunction.


VertexSet

public VertexSet(ProbabilityFunction pf,
                 double[] new_values)
Constructor for a VertexQBProbabilityFunction from a ProbabilityFunction object and new values.

Method Detail

prepare_auxiliary_variable

public VertexSet prepare_auxiliary_variable(BayesNet transformed_bn)
Put together all the values for the possible vertices of credal set and create an auxiliary variable to indicate which vertex to consider There are three things to do: 1) Create an auxiliary_variable with correct values. 2) Combine the values into a new array. 3) Insert the auxiliary_variable into the variables array.


create_new_values

private double[] create_new_values(BayesNet transformed_bn)
Create a new array of values that combines extreme points.


create_auxiliary_variable

private ProbabilityVariable create_auxiliary_variable(BayesNet transformed_bn)
Create an auxiliar variable to indicate the vertices.


evaluate

public double evaluate(java.lang.String[][] variable_value_pairs,
                       int index_extreme_point)
Evaluate a function given a list of pairs (Variable Value) which specifies a value of the function, and the index of the extreme distribution to consider.


set_value

public void set_value(java.lang.String[][] variable_value_pairs,
                      double val,
                      int index_extreme_point)
Set a single value of the probability function.


print

public void print(java.io.PrintStream out)
Print method.

Overrides:
print in class QBProbabilityFunction

compose_values

public void compose_values()
Produce the centroid of all extreme distributions and insert it into the values of the distribution.


set_local_credal_set

public void set_local_credal_set(int number_extreme_points)
Set the number of extreme distributions in the credal set.


set_extreme_point

public void set_extreme_point(int index,
                              double[] ep)
Set an extreme point of the credal set.


get_auxiliary_variable

public ProbabilityVariable get_auxiliary_variable()
Methods that allow basic manipulation of non-public variables.


get_extreme_points

public double[][] get_extreme_points()