public class Rete extends ObjectSource implements Externalizable, ObjectSink
Object. All objects are asserted into
the Rete node where it propagates to all matching ObjectTypeNodes.
The first time an instance of a Class type is asserted it does a full
iteration of all ObjectTyppeNodes looking for matches, any matches are
then cached in a HashMap which is used for future assertions.
While Rete extends ObjectSource nad implements ObjectSink it nulls the
methods attach(), remove() and updateNewNode() as this is the root node
they are no applicableObjectTypeNode,
Serialized FormalphaNodeHashingThreshold, alphaNodeRangeIndexThreshold, declaredMask, inferredMask, sink, sourceassociations, hashcode, id, memoryId, partitionId, partitionsEnabled| Constructor and Description |
|---|
Rete() |
Rete(InternalKnowledgeBase kBase) |
| Modifier and Type | Method and Description |
|---|---|
void |
addObjectSink(ObjectSink objectSink)
Adds the
ObjectSink so that it may receive
Objects propagated from this ObjectSource. |
void |
assertObject(InternalFactHandle factHandle,
PropagationContext context,
InternalWorkingMemory workingMemory)
This is the entry point into the network for all asserted Facts.
|
void |
byPassModifyToBetaNode(InternalFactHandle factHandle,
ModifyPreviousTuples modifyPreviousTuples,
PropagationContext context,
InternalWorkingMemory workingMemory) |
BitMask |
calculateDeclaredMask(Class modifiedClass,
List<String> settableProperties) |
void |
doAttach(BuildContext context) |
protected boolean |
doRemove(RuleRemovalContext context,
ReteooBuilder builder)
Removes the node from the network.
|
boolean |
equals(Object object) |
EntryPointNode |
getEntryPointNode(EntryPointId entryPoint) |
Map<EntryPointId,EntryPointNode> |
getEntryPointNodes() |
InternalKnowledgeBase |
getKnowledgeBase() |
List<ObjectTypeNode> |
getObjectTypeNodes() |
Map<ObjectType,ObjectTypeNode> |
getObjectTypeNodes(EntryPointId entryPoint) |
short |
getType() |
void |
modifyObject(InternalFactHandle factHandle,
ModifyPreviousTuples modifyPreviousTuples,
PropagationContext context,
InternalWorkingMemory workingMemory) |
void |
networkUpdated(UpdateContext updateContext)
A method that is called for all nodes whose network below them
changed, after the change is complete, providing them with an opportunity
for state update
|
void |
readExternal(ObjectInput in) |
void |
removeObjectSink(ObjectSink objectSink)
Removes the
ObjectSink |
void |
retractObject(InternalFactHandle handle,
PropagationContext context,
InternalWorkingMemory workingMemory)
Retract a fact object from this
RuleBase and the specified
WorkingMemory. |
void |
updateSink(ObjectSink sink,
PropagationContext context,
InternalWorkingMemory workingMemory) |
void |
writeExternal(ObjectOutput out) |
getDeclaredMask, getObjectSinkPropagator, getObjectTypeNode, getParentObjectSource, initDeclaredMask, isInUse, resetInferredMask, setObjectSinkPropagator, setParentObjectSource, setPartitionId, setPartitionIdWithSinks, setSourcePartitionId, updateMaskaddAssociation, addAssociation, attach, getAssociatedRules, getAssociatedRuleSize, getAssociationsSize, getAssociationsSize, getId, getMemoryId, getPartitionId, getSinks, hashCode, initMemoryId, isAssociatedWith, isStreamMode, remove, removeAssociation, setId, setPartitionsEnabled, setStreamMode, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetAssociatedRuleSize, getAssociationsSize, getAssociationsSize, getId, getPartitionId, isAssociatedWithpublic Rete()
public Rete(InternalKnowledgeBase kBase)
public short getType()
getType in interface NetworkNodepublic void assertObject(InternalFactHandle factHandle, PropagationContext context, InternalWorkingMemory workingMemory)
ObjectTypdeNodes asserting the Fact. If the cache does not
exist it first iteraes and builds the cache.assertObject in interface ObjectSinkfactHandle - The FactHandle of the fact to assertcontext - The PropagationContext of the WorkingMemory actionworkingMemory - The working memory session.public void retractObject(InternalFactHandle handle, PropagationContext context, InternalWorkingMemory workingMemory)
RuleBase and the specified
WorkingMemory.handle - The handle of the fact to retract.workingMemory - The working memory session.public void modifyObject(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, InternalWorkingMemory workingMemory)
modifyObject in interface ObjectSinkpublic void addObjectSink(ObjectSink objectSink)
ObjectSink so that it may receive
Objects propagated from this ObjectSource.addObjectSink in class ObjectSourceobjectSink - The ObjectSink to receive propagated
Objects. Rete only accepts ObjectTypeNodes
as parameters to this method, though.public void removeObjectSink(ObjectSink objectSink)
ObjectSourceObjectSinkremoveObjectSink in class ObjectSourceobjectSink - The ObjectSink to removepublic void doAttach(BuildContext context)
public void networkUpdated(UpdateContext updateContext)
BaseNodenetworkUpdated in class ObjectSourceprotected boolean doRemove(RuleRemovalContext context, ReteooBuilder builder)
BaseNodeObjectSource or TupleSourcedoRemove in class ObjectSourcepublic EntryPointNode getEntryPointNode(EntryPointId entryPoint)
public List<ObjectTypeNode> getObjectTypeNodes()
public Map<ObjectType,ObjectTypeNode> getObjectTypeNodes(EntryPointId entryPoint)
public InternalKnowledgeBase getKnowledgeBase()
getKnowledgeBase in class ObjectSourcepublic void updateSink(ObjectSink sink, PropagationContext context, InternalWorkingMemory workingMemory)
updateSink in class ObjectSourcepublic void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizablewriteExternal in class ObjectSourceIOExceptionpublic void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
readExternal in interface ExternalizablereadExternal in class ObjectSourceIOExceptionClassNotFoundExceptionpublic Map<EntryPointId,EntryPointNode> getEntryPointNodes()
public void byPassModifyToBetaNode(InternalFactHandle factHandle, ModifyPreviousTuples modifyPreviousTuples, PropagationContext context, InternalWorkingMemory workingMemory)
byPassModifyToBetaNode in interface ObjectSinkpublic BitMask calculateDeclaredMask(Class modifiedClass, List<String> settableProperties)
calculateDeclaredMask in class ObjectSourceCopyright © 2001–2021 JBoss by Red Hat. All rights reserved.