nenok.va.sr
Class SRValuation

java.lang.Object
  extended by nenok.va.sr.SRValuation
All Implemented Interfaces:
Serializable, Labeled, Predictability, Valuation
Direct Known Subclasses:
OSRValuation

public abstract class SRValuation
extends Object
implements Valuation, Predictability

Specifies a semiring induced valuation by leading its principal operations of marginalization & combination back to the according semiring operations.

Version:
$LastChangedRevision: 560 $
$LastChangedDate: 2008-03-26 14:37:05 +0100 (Mi, 26 Mrz 2008) $
Author:
Marc Pouly
See Also:
Serialized Form

Nested Class Summary
 class SRValuation.SRPredictor
          Implementation of weight predictor class.
 
Nested classes/interfaces inherited from interface nenok.va.Predictability
Predictability.Implementor
 
Field Summary
protected  Semiring[] values
           
protected  FiniteVariable[] variables
           
 
Constructor Summary
SRValuation(FiniteVariable[] vars, Semiring[] values)
          Constructor:
 
Method Summary
 Valuation combine(Valuation val)
          Combination of valuations.
abstract  SRValuation create(FiniteVariable[] vars, Semiring[] values)
          Factory method:
 boolean equals(Object o)
           
 Semiring evaluate(FiniteVariable[] vars, Object[] conf)
          Returns the semiring value of the given configuration.
 Semiring[] getValues()
           
 FiniteVariable[] getVariables()
           
 Domain label()
           
 Valuation marginalize(Domain dom)
          Marginalization of a valuation onto a given domain.
 Predictor predictor()
           
 String toString()
           
 int weight()
          Weight function:
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

variables

protected FiniteVariable[] variables

values

protected Semiring[] values
Constructor Detail

SRValuation

public SRValuation(FiniteVariable[] vars,
                   Semiring[] values)
Constructor:

Parameters:
vars - The variables of this semiring valuation.
values - The semiring value for each possible configuration.
The number of values must match with the product computed from each variable's frame cardinality.
Method Detail

create

public abstract SRValuation create(FiniteVariable[] vars,
                                   Semiring[] values)
Factory method:

Parameters:
vars - The variables of this semiring valuation.
values - The semiring value for each possible configuration.
Returns:
A new instance of this class.

label

public Domain label()
Specified by:
label in interface Labeled
Returns:
The domain of this object.
See Also:
Labeled.label()

combine

public Valuation combine(Valuation val)
Description copied from interface: Valuation
Combination of valuations.

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)
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.
See Also:
Valuation.marginalize(nenok.va.Domain)

weight

public int weight()
Description copied from interface: Valuation
Weight function:

Specified by:
weight in interface Valuation
Returns:
The valuation's weight.
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)

evaluate

public Semiring evaluate(FiniteVariable[] vars,
                         Object[] conf)
Returns the semiring value of the given configuration. In order to make this method independent from the variable (configuration) order, the variable array to which the configuration is relativ is given.

Parameters:
vars - The variable array that specifies the configuration's order.
conf - The configuration whose value is returned.
Returns:
The value of the given configuration or null if no such configuration exists.

toString

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

getValues

public Semiring[] getValues()
Returns:
The array of semiring values.

getVariables

public FiniteVariable[] getVariables()
Returns:
The variable array of this semiring valuation.