nenok.va.semiring
Class Configuration

java.lang.Object
  extended by nenok.va.semiring.Configuration
All Implemented Interfaces:
Serializable

public class Configuration
extends Object
implements Serializable

The semiring implementation uses configurations as fundamental computing element. Configurations are arrays of elements of discrete variables. Therefore, this class represents a configuration by the following components:

Both arrays have the same size and the i-th value belongs to the i-th variable. Configurations have three basic operations, namely: labeling, projection and combination. These operations will induce their correspondances in a valuation algebra.

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

Constructor Summary
Configuration(FiniteVariable[] variables, Object[] values)
          Constructor:
 
Method Summary
 Configuration combine(Configuration c)
          This method computes the combination of two configurations.
 boolean equals(Object c)
           
 Object[] getValues()
           
 FiniteVariable[] getVariables()
           
protected  boolean isCombinable(Configuration c)
          Is it possible to compute the combination of this and c.
 Domain label()
          Implementation of the labeling procedure.
 Configuration project(Domain dom)
          The operation of projection restricts a configuration to a given set of variables.
 int size()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Configuration

public Configuration(FiniteVariable[] variables,
                     Object[] values)
Constructor:

Parameters:
variables - The variables of this configuration.
values - The values corresponding to the array of variables. Value i belongs to variable i.
Method Detail

label

public Domain label()
Implementation of the labeling procedure. Creates and returns a domain object containing the configuration's set of variables.

Returns:
The configuration's domain.

project

public Configuration project(Domain dom)
                      throws VAException
The operation of projection restricts a configuration to a given set of variables. Each projection creates a new configuration instance. Note that the argument must be a subset of this.label().

Parameters:
dom - The domain onto the projection is performed.
Returns:
The resulting configuration.
Throws:
VAException - Exception thrown when projecting on illegal domain.

equals

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

size

public int size()
Returns:
The size of this configuration.

combine

public Configuration combine(Configuration c)
This method computes the combination of two configurations. Each call of this method creates a new configuration instance. The two initial configurations stay untouched.

Parameters:
c - The second configuration to be combined with this.
Returns:
The combined configuration as a new object.

isCombinable

protected boolean isCombinable(Configuration c)
Is it possible to compute the combination of this and c.

Parameters:
c - The second configuration.
Returns:
true if the combination can be performed.

toString

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

getVariables

public FiniteVariable[] getVariables()
Returns:
Returns the variable array of this configuration.

getValues

public Object[] getValues()
Returns:
Returns the value array of this configuration.