nenok.va.semiring
Class SRValuation

java.lang.Object
  extended by nenok.va.semiring.SRValuation
All Implemented Interfaces:
Serializable, Cloneable, Predictability, Valuation
Direct Known Subclasses:
RegularSRValuation

public class SRValuation
extends Object
implements Predictability

Specifies a semiring induced valuation by leading its principal operations of labeling, marginalization & combination back to the semiring operations. Furthermore, all semiring induced valuation algebras possess a weight predictor. Therefore, this class extends Predictability.

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

Field Summary
protected  Configuration[] configurations
           
protected  Element[] elements
           
 
Constructor Summary
SRValuation()
          Constructor:
SRValuation(FiniteVariable[] variables, Element[] elements)
          Constructor:
 
Method Summary
 Valuation combine(Valuation val)
          Combination of valuations.
 String displayConfigurations()
           
 boolean equals(Object o)
           
 Domain label()
          Labeling of a valuation.
 Valuation marginalize(Domain dom)
          Marginalization of a valuation onto a given domain.
 Predictor predictor()
           
 String toString()
           
 int weight()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

configurations

protected Configuration[] configurations

elements

protected Element[] elements
Constructor Detail

SRValuation

public SRValuation()
Constructor:


SRValuation

public SRValuation(FiniteVariable[] variables,
                   Element[] elements)
Constructor:

Parameters:
variables - The variables of this valuation.
elements - The semiring elements assigned to the configurations.
Method Detail

label

public Domain label()
Description copied from interface: Valuation
Labeling of a valuation.

Specified by:
label in interface Valuation
Returns:
The domain of the valuation
See Also:
Valuation.label()

combine

public Valuation combine(Valuation val)
Description copied from interface: Valuation
Combination of valuations. Note that the method's argument is declared to be final to prevent modifications on this object.

Specified by:
combine in interface Valuation
Parameters:
val - The second valuation involved in the combination.
Returns:
The combination of this and val.
See Also:
Valuation.combine(nenok.va.Valuation)

marginalize

public Valuation marginalize(Domain dom)
                      throws VAException
Description copied from interface: Valuation
Marginalization of a valuation onto a given domain.

Specified by:
marginalize in interface Valuation
Parameters:
dom - The domain onto this valuation is marginalized.
Returns:
The marginalization of this to dom.
Throws:
VAException - Exception occuring when a marginalization is performed onto an illegal domain.
See Also:
Valuation.marginalize(nenok.va.Domain)

weight

public int weight()
Specified by:
weight in interface Valuation
Returns:
The wieght of the current valuation.
See Also:
Valuation.weight()

predictor

public Predictor predictor()
Specified by:
predictor in interface Predictability
Returns:
A predictor instance corresponding to this valuation algebra.
See Also:
Predictability.predictor()

equals

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

toString

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

displayConfigurations

public String displayConfigurations()
Returns:
The current semiring valuation as a string.