public abstract class DualInputNode extends StandardNode
Modifier and Type | Class and Description |
---|---|
static class |
DualInputNode.Side |
Modifier and Type | Field and Description |
---|---|
protected boolean |
coincidence
true if the primary and secondary slots coincide
|
protected TupleMask |
complementerSecondaryMask
Optional complementer mask
|
protected IterableIndexer |
primarySlot
Holds the primary input slot of this node.
|
protected Indexer |
secondarySlot
Holds the secondary input slot of this node.
|
children
communicationTracker, nodeId, reteContainer, tag, traceInfos
Constructor and Description |
---|
DualInputNode(ReteContainer reteContainer,
TupleMask complementerSecondaryMask) |
Modifier and Type | Method and Description |
---|---|
void |
assignTraceInfo(TraceInfo traceInfo)
assigns new traceability info to this node
|
abstract Tuple |
calibrate(Tuple primary,
Tuple secondary)
Simulates the behaviour of the node for calibration purposes only.
|
void |
connectToIndexers(IterableIndexer primarySlot,
Indexer secondarySlot)
Should be called only once, when node is initialized
|
IterableIndexer |
getPrimarySlot() |
Indexer |
getSecondarySlot() |
protected Indexer |
getSlot(DualInputNode.Side side)
Retrieves the slot corresponding to the specified side.
|
abstract void |
notifyUpdate(DualInputNode.Side side,
Direction direction,
Tuple updateElement,
Tuple signature,
boolean change)
Abstract handler for update event.
|
protected java.util.Collection<Tuple> |
retrieveOpposites(DualInputNode.Side side,
Tuple signature)
Helper: retrieves all stored substitutions from the opposite side memory.
|
void |
setComplementerSecondaryMask(TupleMask complementerSecondaryMask) |
protected Tuple |
unify(DualInputNode.Side side,
Tuple ps,
Tuple opposite)
Helper: unifies the a substitution from the specifies side with another substitution from the other side.
|
protected Tuple |
unify(Tuple left,
Tuple right)
Helper: unifies a left and right partial matching.
|
appendChild, constructIndex, getPulledContents, getReceivers, issueError, propagateUpdate, removeChild
acceptPropagatedTraceInfo, getContainer, getNodeId, getTag, getTraceInfoPatternsEnumerated, getTraceInfos, setTag, toString, toStringCore
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
acceptPropagatedTraceInfo, getContainer, getNodeId, getTag, getTraceInfos, setTag
protected IterableIndexer primarySlot
protected Indexer secondarySlot
protected TupleMask complementerSecondaryMask
protected boolean coincidence
public DualInputNode(ReteContainer reteContainer, TupleMask complementerSecondaryMask)
reteContainer
- public IterableIndexer getPrimarySlot()
public Indexer getSecondarySlot()
public void connectToIndexers(IterableIndexer primarySlot, Indexer secondarySlot)
protected java.util.Collection<Tuple> retrieveOpposites(DualInputNode.Side side, Tuple signature)
protected Tuple unify(Tuple left, Tuple right)
protected Tuple unify(DualInputNode.Side side, Tuple ps, Tuple opposite)
public abstract void notifyUpdate(DualInputNode.Side side, Direction direction, Tuple updateElement, Tuple signature, boolean change)
side
- The side on which the event occured.direction
- The direction of the update.updateElement
- The partial matching that is inserted.signature
- Masked signature of updateElement.change
- Indicates whether this is/was the first/last instance of this signature in this slot.public abstract Tuple calibrate(Tuple primary, Tuple secondary)
public void setComplementerSecondaryMask(TupleMask complementerSecondaryMask)
complementerSecondaryMask
- the complementerSecondaryMask to setprotected Indexer getSlot(DualInputNode.Side side)
public void assignTraceInfo(TraceInfo traceInfo)
Node
assignTraceInfo
in interface Node
assignTraceInfo
in class BaseNode