Class UniquenessEnforcerNode
java.lang.Object
tools.refinery.interpreter.rete.network.BaseNode
tools.refinery.interpreter.rete.network.StandardNode
tools.refinery.interpreter.rete.single.AbstractUniquenessEnforcerNode
tools.refinery.interpreter.rete.single.UniquenessEnforcerNode
- All Implemented Interfaces:
IGroupable
,NetworkStructureChangeSensitiveNode
,Node
,PosetAwareReceiver
,Receiver
,RederivableNode
,Supplier
,Tunnel
- Direct Known Subclasses:
DefaultProductionNode
public class UniquenessEnforcerNode
extends AbstractUniquenessEnforcerNode
implements RederivableNode, PosetAwareReceiver
Timeless uniqueness enforcer node implementation.
The node is capable of operating in the delete and re-derive mode. In this mode, it is also possible to equip the
node with an IPosetComparator
to identify monotone changes; thus, ensuring that a fix-point can be reached
during the evaluation.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final TupleMask
OPTIONAL ELEMENT - ONLY PRESENT IF MONOTONICITY INFO WAS AVAILABLEprotected CommunicationGroup
protected boolean
protected final IPosetComparator
OPTIONAL ELEMENTS - ONLY PRESENT IF MONOTONICITY INFO WAS AVAILABLEprotected final TupleMask
OPTIONAL ELEMENTS - ONLY PRESENT IF MONOTONICITY INFO WAS AVAILABLEFields inherited from class tools.refinery.interpreter.rete.single.AbstractUniquenessEnforcerNode
identityMask, mailbox, memoryIdentityIndexer, memoryNullIndexer, nullMask, parents, specializedListeners, tupleWidth
Fields inherited from class tools.refinery.interpreter.rete.network.StandardNode
childMailboxes, children
Fields inherited from class tools.refinery.interpreter.rete.network.BaseNode
nodeId, reteContainer, tag, traceInfos
-
Constructor Summary
ConstructorsConstructorDescriptionUniquenessEnforcerNode
(ReteContainer reteContainer, int tupleWidth) UniquenessEnforcerNode
(ReteContainer reteContainer, int tupleWidth, boolean deleteRederiveEvaluation) UniquenessEnforcerNode
(ReteContainer reteContainer, int tupleWidth, boolean deleteRederiveEvaluation, TupleMask coreMask, TupleMask posetMask, IPosetComparator posetComparator) -
Method Summary
Modifier and TypeMethodDescriptionprotected Mailbox
boolean
Returns true if this node actually runs in DRed mode (not necessarily).void
pullInto
(Collection<Tuple> collector, boolean flush) Pulls the contents of this object in this particular moment into a target collection.void
pullIntoWithTimeline
(Map<Tuple, Timeline<Timestamp>> collector, boolean flush) void
The method is called by theReteContainer
to re-derive tuples after the normal messages have been delivered and consumed.void
setCurrentGroup
(CommunicationGroup currentGroup) Sets the current group of the mailboxvoid
Updates the receiver with a newly found or lost partial matching.protected boolean
updateDefault
(Direction direction, Tuple update) protected boolean
updateWithDeleteAndRederive
(Direction direction, Tuple update, boolean monotone) void
updateWithPosetInfo
(Direction direction, Tuple update, boolean monotone) Updates the receiver with a newly found or lost partial matching also providing information whether the update is a monotone change or not.Methods inherited from class tools.refinery.interpreter.rete.single.AbstractUniquenessEnforcerNode
appendParent, assignTraceInfo, constructIndex, getMailbox, getParents, propagate, removeParent
Methods inherited from class tools.refinery.interpreter.rete.network.StandardNode
appendChild, getChildMailboxes, getPulledContents, getReceivers, issueError, networkStructureChanged, propagateUpdate, removeChild
Methods inherited from class tools.refinery.interpreter.rete.network.BaseNode
acceptPropagatedTraceInfo, getContainer, getNodeId, getTag, getTraceInfoPatternsEnumerated, getTraceInfos, setTag, toString, toStringCore
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface tools.refinery.interpreter.rete.network.Node
acceptPropagatedTraceInfo, assignTraceInfo, getCommunicationTracker, getContainer, getNodeId, getTag, getTraceInfos, setTag
Methods inherited from interface tools.refinery.interpreter.rete.network.Receiver
appendParent, batchUpdate, getMailbox, getParents, removeParent
Methods inherited from interface tools.refinery.interpreter.rete.network.Supplier
appendChild, getPulledContents, getPulledContents, getReceivers, removeChild
-
Field Details
-
memory
-
rederivableMemory
- Since:
- 1.6
-
deleteRederiveEvaluation
protected boolean deleteRederiveEvaluation- Since:
- 1.6
-
currentGroup
- Since:
- 1.7
-
coreMask
OPTIONAL ELEMENT - ONLY PRESENT IF MONOTONICITY INFO WAS AVAILABLE- Since:
- 1.6
-
posetMask
OPTIONAL ELEMENTS - ONLY PRESENT IF MONOTONICITY INFO WAS AVAILABLE- Since:
- 1.6
-
posetComparator
OPTIONAL ELEMENTS - ONLY PRESENT IF MONOTONICITY INFO WAS AVAILABLE- Since:
- 1.6
-
-
Constructor Details
-
UniquenessEnforcerNode
-
UniquenessEnforcerNode
public UniquenessEnforcerNode(ReteContainer reteContainer, int tupleWidth, boolean deleteRederiveEvaluation) - Since:
- 1.6
-
UniquenessEnforcerNode
public UniquenessEnforcerNode(ReteContainer reteContainer, int tupleWidth, boolean deleteRederiveEvaluation, TupleMask coreMask, TupleMask posetMask, IPosetComparator posetComparator) - Since:
- 1.6
-
-
Method Details
-
pullInto
Description copied from interface:Supplier
Pulls the contents of this object in this particular moment into a target collection. -
getTuples
- Specified by:
getTuples
in classAbstractUniquenessEnforcerNode
- Since:
- 2.8
-
isInDRedMode
public boolean isInDRedMode()Description copied from interface:RederivableNode
Returns true if this node actually runs in DRed mode (not necessarily).- Specified by:
isInDRedMode
in interfaceRederivableNode
- Returns:
- true if the node is operating in DRed mode
-
getCoreMask
- Specified by:
getCoreMask
in interfacePosetAwareReceiver
-
getPosetMask
- Specified by:
getPosetMask
in interfacePosetAwareReceiver
-
getPosetComparator
- Specified by:
getPosetComparator
in interfacePosetAwareReceiver
-
pullIntoWithTimeline
- Specified by:
pullIntoWithTimeline
in interfaceSupplier
-
instantiateMailbox
- Specified by:
instantiateMailbox
in classAbstractUniquenessEnforcerNode
- Since:
- 2.0
-
update
Description copied from interface:Receiver
Updates the receiver with a newly found or lost partial matching. -
updateWithPosetInfo
Description copied from interface:PosetAwareReceiver
Updates the receiver with a newly found or lost partial matching also providing information whether the update is a monotone change or not.- Specified by:
updateWithPosetInfo
in interfacePosetAwareReceiver
- Parameters:
direction
- the direction of the updateupdate
- the update tuplemonotone
- true if the update is monotone, false otherwise
-
updateWithDeleteAndRederive
- Since:
- 2.4
-
updateDefault
- Since:
- 2.4
-
rederiveOne
public void rederiveOne()Description copied from interface:RederivableNode
The method is called by theReteContainer
to re-derive tuples after the normal messages have been delivered and consumed. The re-derivation process may trigger the creation and delivery of further messages and further re-derivation rounds.- Specified by:
rederiveOne
in interfaceRederivableNode
- Since:
- 1.6
-
getNullIndexer
- Specified by:
getNullIndexer
in classAbstractUniquenessEnforcerNode
-
getIdentityIndexer
- Specified by:
getIdentityIndexer
in classAbstractUniquenessEnforcerNode
-
getCurrentGroup
- Specified by:
getCurrentGroup
in interfaceIGroupable
- Returns:
- the current group of the mailbox
-
setCurrentGroup
Description copied from interface:IGroupable
Sets the current group of the mailbox- Specified by:
setCurrentGroup
in interfaceIGroupable
-