Reasoner
Class DynamicReasoner

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

public class DynamicReasoner
extends java.lang.Object

Generates inferences from the solution set of the reasoning engine.

Version:
Created 5 September 2003
Author:
Dan Tappan
See Also:
StaticReasoner, SimulationEngine

Field Summary
private  KnowledgeBase m_knowledge_base
           
private  MonteCarloRunSet m_monte_carlo_run_set
           
private  ObjectTemplateSet m_object_template_set
           
private  SemanticNetwork m_semantic_network
           
private  StaticReasoner m_static_reasoner
           
 
Constructor Summary
DynamicReasoner(SimulationEngine simulation_engine, MonteCarloRunSet monte_carlo_run_set, boolean generate_inferences)
          Creates a new dynamic reasoner that builds late inferences from a Monte Carlo run set and back-fills them into the original semantic network.
 
Method Summary
private  void buildLateAttributeInferences(java.util.ArrayList attribute_inferences, ObjectInference object_inference)
          Builds attribute instances for the attribute inferences and adds them to the semantic network.
private  void buildLateInferences()
          Builds the late inferences from the Monte Carlo run set.
private  void buildLateRelationshipInferences(java.util.ArrayList relationship_inferences, ObjectInference object_inference1, ObjectInference object_inference2)
          Builds relationship instances for the relationship inferences and adds them to the semantic network.
private  java.util.ArrayList extractBindableInferenceNodesFromNestedDependencyNodes(java.util.ArrayList dependency_nodes)
          Returns a list of inference nodes at any level at and/or beneath a list of dependency nodes.
private  void extractBindableInferenceNodesFromNestedDependencyNodes(DependencyNode dependency_node, java.util.ArrayList inference_nodes)
          Recursively builds a list of inference nodes in and/or contained beneath a dependency node.
 SemanticNetwork getSemanticNetworkInstance()
          Returns the semantic network augmented by any inferences made in this dynamic reasoner.
 java.lang.String toString()
          Returns a string representation of this class.
 
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_knowledge_base

private KnowledgeBase m_knowledge_base

m_static_reasoner

private StaticReasoner m_static_reasoner

m_monte_carlo_run_set

private MonteCarloRunSet m_monte_carlo_run_set

m_object_template_set

private ObjectTemplateSet m_object_template_set
Constructor Detail

DynamicReasoner

public DynamicReasoner(SimulationEngine simulation_engine,
                       MonteCarloRunSet monte_carlo_run_set,
                       boolean generate_inferences)
                throws java.lang.Exception
Creates a new dynamic reasoner that builds late inferences from a Monte Carlo run set and back-fills them into the original semantic network.

Parameters:
simulation_engine - - the simulation engine
monte_carlo_run_set - - the Monte Carlo run set
generate_inferences - - whether inferences should be generated
Throws:
java.lang.Exception - - if the reasoning process fails
Method Detail

buildLateInferences

private void buildLateInferences()
                          throws java.lang.Exception
Builds the late inferences from the Monte Carlo run set.

Throws:
java.lang.Exception - - if any inferences cannot be built

buildLateAttributeInferences

private void buildLateAttributeInferences(java.util.ArrayList attribute_inferences,
                                          ObjectInference object_inference)
                                   throws java.lang.Exception
Builds attribute instances for the attribute inferences and adds them to the semantic network.

Parameters:
attribute_inferences - - the attribute inference nodes
object_inference - - the object inference to bind the attribute to
Throws:
java.lang.Exception - - if any attribute inferences cannot be built

buildLateRelationshipInferences

private void buildLateRelationshipInferences(java.util.ArrayList relationship_inferences,
                                             ObjectInference object_inference1,
                                             ObjectInference object_inference2)
                                      throws java.lang.Exception
Builds relationship instances for the relationship inferences and adds them to the semantic network.

Parameters:
relationship_inferences - - the relationship inference nodes
object_inference1 - - the left-hand-side object inference to bind the relationship to
object_inference2 - - the right-hand-side object inference to bind the relationship to
Throws:
java.lang.Exception - - if any relationship inferences cannot be built

extractBindableInferenceNodesFromNestedDependencyNodes

private java.util.ArrayList extractBindableInferenceNodesFromNestedDependencyNodes(java.util.ArrayList dependency_nodes)
Returns a list of inference nodes at any level at and/or beneath a list of dependency nodes.

Parameters:
dependency_nodes - - the dependency nodes to process
Returns:
the inference nodes, with duplicates removed
See Also:
extractBindableInferenceNodesFromNestedDependencyNodes(DependencyNode, ArrayList)

extractBindableInferenceNodesFromNestedDependencyNodes

private void extractBindableInferenceNodesFromNestedDependencyNodes(DependencyNode dependency_node,
                                                                    java.util.ArrayList inference_nodes)
Recursively builds a list of inference nodes in and/or contained beneath a dependency node.

Parameters:
dependency_node - - the dependency node to process
inference_nodes - - the list of inference nodes. This is an in-out parameter
See Also:
extractBindableInferenceNodesFromNestedDependencyNodes(ArrayList)

getSemanticNetworkInstance

public SemanticNetwork getSemanticNetworkInstance()
Returns the semantic network augmented by any inferences made in this dynamic reasoner.

Returns:
the semantic network instance
See Also:
MonteCarloRunSet.setSemanticNetworkInstance(SemanticNetwork.SemanticNetwork)

toString

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

Overrides:
toString in class java.lang.Object
Returns:
the String representation