ppotentials
Class Potential

java.lang.Object
  extended by ppotentials.Potential
All Implemented Interfaces:
Serializable, Cloneable, Predictability, Regularity, Scalability, Valuation

public class Potential
extends Object
implements Predictability, Scalability

Probability potential are an example of a valuation algebra and this class offers a possible implementation of the valuation interface for the case of probability potentials.

Version:
1.1
Author:
Marc Pouly
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface nenok.va.Scalability
Scalability.Implementor
 
Constructor Summary
protected Potential(PP_Variable[] variables, double[] probabilities)
          Private constructor: Sets instance fields and performs dimension check.
  Potential(PP_Variable variable, double[] probabilities)
          Constructor:
  Potential(PP_Variable variable, PP_Variable[] conditionals, double[] probabilities)
          Constructor:
 
Method Summary
 Valuation combine(Valuation val)
           
 JComponent displayChart()
          Displays the current potential as a chart.
 String displayText()
           
 boolean equals(Object o)
           
 double[] getProbabilities()
           
protected  int getSymbolIndex(int varPos, int configuration)
          This method returns the index of the variable's value at a specifique configuration.
protected  PP_Variable[] getVariables()
           
 Regularity inverse()
           
 Domain label()
           
 Valuation marginalize(Domain dom)
           
 Predictor predictor()
           
 Scalability scale()
           
 String toString()
           
 int weight()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Potential

public Potential(PP_Variable variable,
                 double[] probabilities)
Constructor:

Parameters:
variable - The main variable of this potential.
probabilities - The probability for each possible configuration.
The number of probabilities must match with the product computed from each variable's frame cardinality.

Potential

public Potential(PP_Variable variable,
                 PP_Variable[] conditionals,
                 double[] probabilities)
Constructor:

Parameters:
variable - The main variable of this potential.
conditionals - The conditional variables of this potential.
probabilities - The probability for each possible configuration.
The number of probabilities must match with the product computed from each variable's frame cardinality.

Potential

protected Potential(PP_Variable[] variables,
                    double[] probabilities)
Private constructor: Sets instance fields and performs dimension check.

Parameters:
variables - An array of discrete variables.
probabilities - An array of probabilities.
Method Detail

label

public Domain label()
Specified by:
label in interface Valuation
See Also:
Valuation.label()

combine

public Valuation combine(Valuation val)
Specified by:
combine in interface Valuation
See Also:
Valuation.combine(nenok.va.Valuation)

marginalize

public Valuation marginalize(Domain dom)
Specified by:
marginalize in interface Valuation
See Also:
Valuation.marginalize(nenok.va.Domain)

weight

public int weight()
Specified by:
weight in interface Valuation
See Also:
Valuation.weight()

predictor

public Predictor predictor()
Specified by:
predictor in interface Predictability
See Also:
Predictability.predictor()

inverse

public Regularity inverse()
Specified by:
inverse in interface Regularity
See Also:
Regularity.inverse()

scale

public Scalability scale()
Specified by:
scale in interface Scalability
See Also:
Scalability.scale()

equals

public boolean equals(Object o)
Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

displayText

public String displayText()
Returns:
The current potential as a string.

displayChart

public JComponent displayChart()
Displays the current potential as a chart.

Returns:
The current potential as a chart.

toString

public String toString()
Overrides:
toString in class Object
See Also:
Object.toString()

getSymbolIndex

protected int getSymbolIndex(int varPos,
                             int configuration)
This method returns the index of the variable's value at a specifique configuration.

Parameters:
varPos - The variable caracterized by its position.
configuration - The configuration
Returns:
Ths symbol of the variable at the given configuration. Example:
getSymbol(0,3) returns the index of variable 0's symbol at configuration 3.

getVariables

protected PP_Variable[] getVariables()
Returns:
Returns the variables of this potential.

getProbabilities

public double[] getProbabilities()
Returns:
Returns the probability array of this potential.