Reasoner
Class Distiller

java.lang.Object
  |
  +--Reasoner.Distiller

public class Distiller
extends java.lang.Object

Distills a set of MonteCarloRunSets created by the Reasoner into a set of slightly different interpetations, each of which will be rendered as its own Sandbox. Distillation serves two purposes:

  1. It clusters different instances of the same object depending on the similarity of their properties.
  2. It averages the contents of each cluster to present a single, unified intepretation.

Any number of Distillers can be run on the same aggregrate data for experimentation and comparison purposes. Distillation does not affect the raw source data.

Since distillation eliminates some interpretations by combining them if they are similar, there can never be more interpretations (or Sandboxes) than there are MonteCarloRunSets.

Version:
Created 14 March 2003
Author:
Dan Tappan
See Also:
MonteCarloRunSet, Reasoner, Sandbox

Field Summary
private  float COMPOSITE_OBJECT_TRANSPARENCY
           
private  boolean ENABLE_VERBOSE_LOGGING
           
private  java.lang.String m_depiction_name
           
private  java.util.ArrayList m_monte_carlo_run_sets
           
private  SemanticNetwork m_semantic_network
           
private  double SIGMA_SCALE_FACTOR
           
 
Constructor Summary
Distiller(java.lang.String depiction_name, SemanticNetwork semantic_network)
          Creates a new Distiller.
 
Method Summary
 void addMonteCarloRunSet(MonteCarloRunSet monte_carlo_run_set)
          Adds a MonteCarloRunSet to the collection to be distilled.
 void addMonteCarloRunSets(java.util.ArrayList monte_carlo_run_sets)
          Adds a set of MonteCarloRunSets to the collection to be distilled.
 java.util.LinkedList distillDepiction(boolean return_all_otherwise_one, boolean return_composite)
          Performs a predefined distillation.
 java.util.LinkedList distillDepiction(boolean distill_by_position, float max_position_sigma, boolean distill_by_attitude, float max_attitude_sigma, boolean distill_by_dimensions, float max_dimensions_sigma, boolean return_all_otherwise_one, boolean return_composite)
          Distills the MonteCarloRunSets that have been added into a set of Sandboxes for rendering.
 void export(java.lang.String output_filename, java.util.LinkedList object_set)
          Exports to a file a text representation of the object inferences in the Monte Carlo run sets of this distiller.
 int getMonteCarloRunSetCount()
          Returns the number of MonteCarloRunSets that have been added.
 java.util.ArrayList getMonteCarloRunSets()
          Returns a list of the MonteCarloRunSets that have been added.
 java.lang.String toString()
          Returns a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_semantic_network

private SemanticNetwork m_semantic_network

m_monte_carlo_run_sets

private java.util.ArrayList m_monte_carlo_run_sets

m_depiction_name

private java.lang.String m_depiction_name

COMPOSITE_OBJECT_TRANSPARENCY

private final float COMPOSITE_OBJECT_TRANSPARENCY
See Also:
Constant Field Values

ENABLE_VERBOSE_LOGGING

private final boolean ENABLE_VERBOSE_LOGGING
See Also:
Constant Field Values

SIGMA_SCALE_FACTOR

private final double SIGMA_SCALE_FACTOR
See Also:
Constant Field Values
Constructor Detail

Distiller

public Distiller(java.lang.String depiction_name,
                 SemanticNetwork semantic_network)
Creates a new Distiller.

Parameters:
depiction_name - - the depiction name
semantic_network - - the semantic network defining the source description
Method Detail

addMonteCarloRunSet

public void addMonteCarloRunSet(MonteCarloRunSet monte_carlo_run_set)
Adds a MonteCarloRunSet to the collection to be distilled.

Parameters:
monte_carlo_run_set - - the set to add

addMonteCarloRunSets

public void addMonteCarloRunSets(java.util.ArrayList monte_carlo_run_sets)
Adds a set of MonteCarloRunSets to the collection to be distilled.

Parameters:
monte_carlo_run_sets - - the set to add

distillDepiction

public java.util.LinkedList distillDepiction(boolean return_all_otherwise_one,
                                             boolean return_composite)
                                      throws java.lang.Exception
Performs a predefined distillation. This is equivalent to calling distillDepiction() with all the averaging parameters at zero or infinity. At zero all interpretations are returned; at infinity one averaged interpretation is.

Parameters:
return_all_otherwise_one - - whether to return all interpretations or one
return_composite - - whether the composite interpretation of the aggregrate sets should be returned
Returns:
a list of sandboxes defines as Monte Carlo run sets
Throws:
java.lang.Exception - - if distillation fails for any reason
See Also:
Sandbox

distillDepiction

public java.util.LinkedList distillDepiction(boolean distill_by_position,
                                             float max_position_sigma,
                                             boolean distill_by_attitude,
                                             float max_attitude_sigma,
                                             boolean distill_by_dimensions,
                                             float max_dimensions_sigma,
                                             boolean return_all_otherwise_one,
                                             boolean return_composite)
                                      throws java.lang.Exception
Distills the MonteCarloRunSets that have been added into a set of Sandboxes for rendering. Each Sandbox portrays a slight different interpretation of the aggregrate sets as specified in the parameters.

Parameters:
distill_by_position - - whether position deviation contributes to distillation
max_position_sigma - - the minimum sigma difference between object positions to spawn a new interpretation. This applies only when distill_by_position is enabled
distill_by_attitude - - whether attitude deviation contributes to distillation
max_attitude_sigma - - the minimum sigma difference between object attitudes to spawn a new interpretation. This applies only when distill_by_attitude is enabled
distill_by_dimensions - - whether dimensions deviation contribute to distillation
max_dimensions_sigma - - the minimum sigma difference between object dimensions to spawn a new interpretation. This applies only when max_dimensions_sigma is enabled
return_all_otherwise_one - - whether to return all interpretations or one
return_composite - - whether the composite interpretation of the aggregrate sets should be returned
Returns:
a list of sandboxes defines as Monte Carlo run sets
Throws:
java.lang.Exception - - if distillation fails
See Also:
Sandbox

export

public void export(java.lang.String output_filename,
                   java.util.LinkedList object_set)
            throws java.lang.Exception
Exports to a file a text representation of the object inferences in the Monte Carlo run sets of this distiller. This is used by Visio to render a two-dimensional top-view figure.

Parameters:
output_filename - - the fully qualified output filename
object_set - - the distilled object set to export, or null to use the Monte Carlo run sets stored in this distiller, which is equivalent to this.export(output_filename, this.getMonteCarloRunSets())
Throws:
java.lang.Exception - - if the export fails

getMonteCarloRunSetCount

public int getMonteCarloRunSetCount()
Returns the number of MonteCarloRunSets that have been added.

Returns:
the count

getMonteCarloRunSets

public java.util.ArrayList getMonteCarloRunSets()
Returns a list of the MonteCarloRunSets that have been added.

Returns:
the run sets
See Also:
MonteCarloRunSet

toString

public java.lang.String toString()
Returns a string representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
the String representation
See Also:
Support.toPrettyString(java.lang.String)