站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBoss RULES 4.0.0.11754MR2 API 英文版文档

TruthMaintenanceSystem (Drools 4.0.0.11754MR2 API) - JBoss RULES 4.0.0.11754MR2 API 英文版文档


org.drools.common
Class TruthMaintenanceSystem

java.lang.Object
  extended by org.drools.common.TruthMaintenanceSystem
All Implemented Interfaces:
Serializable

public class TruthMaintenanceSystem
extends Object
implements Serializable

The Truth Maintenance System is responsible for tracking two things. Firstly It maintains a Map to track the classes with the same Equality, using the EqualityKey. The EqualityKey has an internal datastructure which references all the handles which are equal. Secondly It maintains another map tracking the justificiations for logically asserted facts.

Author:
Mark Proctor
See Also:
Serialized Form

Nested Class Summary
static class TruthMaintenanceSystem.LogicalRetractCallback
           
 
Constructor Summary
TruthMaintenanceSystem(AbstractWorkingMemory workingMemory)
           
 
Method Summary
 void addLogicalDependency(InternalFactHandle handle, Activation activation, PropagationContext context, Rule rule)
          Adds a justification for the FactHandle to the justifiedMap.
 EqualityKey get(EqualityKey key)
           
 EqualityKey get(Object object)
           
 ObjectHashMap getAssertMap()
           
 PrimitiveLongMap getJustifiedMap()
           
 Object put(EqualityKey key)
           
 EqualityKey remove(EqualityKey key)
           
 void removeLogicalDependencies(Activation activation, PropagationContext context, Rule rule)
          An Activation is no longer true so it no longer justifies any of the logical facts it logically asserted.
 void removeLogicalDependencies(InternalFactHandle handle)
          The FactHandle is being removed from the system so remove any logical dependencies between the justified FactHandle and its justifiers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TruthMaintenanceSystem

public TruthMaintenanceSystem(AbstractWorkingMemory workingMemory)
Method Detail

getJustifiedMap

public PrimitiveLongMap getJustifiedMap()

getAssertMap

public ObjectHashMap getAssertMap()

put

public Object put(EqualityKey key)

get

public EqualityKey get(EqualityKey key)

get

public EqualityKey get(Object object)

remove

public EqualityKey remove(EqualityKey key)

removeLogicalDependencies

public void removeLogicalDependencies(Activation activation,
                                      PropagationContext context,
                                      Rule rule)
                               throws FactException
An Activation is no longer true so it no longer justifies any of the logical facts it logically asserted. It iterates over the Activation's LinkedList of DependencyNodes it retrieves the justitication set for each DependencyNode's FactHandle and removes itself. If the Set is empty it retracts the FactHandle from the WorkingMemory.

Parameters:
activation -
context -
rule -
Throws:
FactException

removeLogicalDependencies

public void removeLogicalDependencies(InternalFactHandle handle)
                               throws FactException
The FactHandle is being removed from the system so remove any logical dependencies between the justified FactHandle and its justifiers. Removes the FactHandle key from the justifiedMap. It then iterates over all the LogicalDependency nodes, if any, in the returned Set and removes the LogicalDependency node from the LinkedList maintained by the Activation.

Parameters:
handle - - The FactHandle to be removed
Throws:
FactException
See Also:
LogicalDependency

addLogicalDependency

public void addLogicalDependency(InternalFactHandle handle,
                                 Activation activation,
                                 PropagationContext context,
                                 Rule rule)
                          throws FactException
Adds a justification for the FactHandle to the justifiedMap.

Parameters:
handle -
activation -
context -
rule -
Throws:
FactException


Copyright © 2001-2007 JBoss Inc.. All Rights Reserved.