public class ColumnAggregatorNode<Domain,Accumulator,AggregateResult> extends AbstractColumnAggregatorNode<Domain,Accumulator,AggregateResult> implements RederivableNode, PosetAwareReceiver
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.
AbstractColumnAggregatorNode.AggregatorOuterIdentityIndexer, AbstractColumnAggregatorNode.AggregatorOuterIndexer, AbstractColumnAggregatorNode.NetworkStructureChangeSensitiveLogic
Modifier and Type | Field and Description |
---|---|
protected CommunicationGroup |
currentGroup |
protected boolean |
deleteRederiveEvaluation |
protected java.util.Map<Tuple,Accumulator> |
memory |
protected IPosetComparator |
posetComparator |
protected java.util.Map<Tuple,Accumulator> |
rederivableMemory |
aggregatorOuterIdentityIndexers, aggregatorOuterIndexer, columnMask, groupMask, NEUTRAL, operator, runtimeContext, sourceWidth
mailbox, parent
childMailboxes, children
nodeId, reteContainer, tag, traceInfos
Constructor and Description |
---|
ColumnAggregatorNode(ReteContainer reteContainer,
IMultisetAggregationOperator<Domain,Accumulator,AggregateResult> operator,
boolean deleteRederiveEvaluation,
TupleMask groupMask,
TupleMask columnMask,
IPosetComparator posetComparator)
Creates a new column aggregator node.
|
ColumnAggregatorNode(ReteContainer reteContainer,
IMultisetAggregationOperator<Domain,Accumulator,AggregateResult> operator,
TupleMask groupMask,
int aggregatedColumn)
Creates a new column aggregator node.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear all partial matchings stored in memory
|
protected Accumulator |
getAccumulator(Tuple key,
java.util.Map<Tuple,Accumulator> memory) |
AggregateResult |
getAggregateResult(Tuple group) |
java.util.Map<AggregateResult,Timeline<Timestamp>> |
getAggregateResultTimeline(Tuple key) |
Tuple |
getAggregateTuple(Tuple group) |
java.util.Map<Tuple,Timeline<Timestamp>> |
getAggregateTupleTimeline(Tuple key) |
TupleMask |
getCoreMask() |
CommunicationGroup |
getCurrentGroup() |
protected Accumulator |
getMainAccumulator(Tuple key) |
IPosetComparator |
getPosetComparator() |
TupleMask |
getPosetMask() |
protected Accumulator |
getRederivableAccumulator(Tuple key) |
protected Mailbox |
instantiateMailbox()
Instantiates the
Mailbox of this receiver. |
boolean |
isInDRedMode()
Returns true if this node actually runs in DRed mode (not necessarily).
|
void |
rederiveOne()
The method is called by the
ReteContainer to re-derive tuples after the normal messages have been
delivered and consumed. |
void |
setCurrentGroup(CommunicationGroup currentGroup)
Sets the current group of the mailbox
|
protected boolean |
storeIfNotNeutral(Tuple key,
Accumulator accumulator,
java.util.Map<Tuple,Accumulator> memory)
Returns true if the accumulator was stored, false otherwise.
|
void |
update(Direction direction,
Tuple update,
Timestamp timestamp)
Updates the receiver with a newly found or lost partial matching.
|
protected void |
updateDefault(Direction direction,
Tuple update,
Timestamp timestamp) |
protected void |
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.
|
appendChild, getAggregatorOuterIdentityIndexer, getAggregatorOuterIndexer, getCommunicationTracker, propagate, propagateAggregateResultUpdate, pullInto, pullIntoWithTimeline, tupleFromAggregateResult
appendParent, assignTraceInfo, getMailbox, getParents, propagatePullInto, propagatePullIntoWithTimestamp, removeParent
constructIndex, getChildMailboxes, getPulledContents, getReceivers, issueError, networkStructureChanged, propagateUpdate, removeChild
acceptPropagatedTraceInfo, getContainer, getNodeId, getTag, getTraceInfoPatternsEnumerated, getTraceInfos, setTag, toString, toStringCore
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
appendParent, batchUpdate, getMailbox, getParents, removeParent
acceptPropagatedTraceInfo, assignTraceInfo, getCommunicationTracker, getContainer, getNodeId, getTag, getTraceInfos, setTag
constructIndex, getPulledContents, getPulledContents, getReceivers, removeChild
protected final IPosetComparator posetComparator
protected final boolean deleteRederiveEvaluation
protected final java.util.Map<Tuple,Accumulator> memory
protected final java.util.Map<Tuple,Accumulator> rederivableMemory
protected CommunicationGroup currentGroup
public ColumnAggregatorNode(ReteContainer reteContainer, IMultisetAggregationOperator<Domain,Accumulator,AggregateResult> operator, boolean deleteRederiveEvaluation, TupleMask groupMask, TupleMask columnMask, IPosetComparator posetComparator)
reteContainer
- the RETE container of the nodeoperator
- the aggregation operatordeleteRederiveEvaluation
- true if the node should run in DRED mode, false otherwisegroupMask
- the mask that masks a tuple to obtain the key that we are grouping-bycolumnMask
- the mask that masks a tuple to obtain the tuple element(s) that we are aggregating overposetComparator
- the poset comparator for the column, if known, otherwise it can be nullpublic ColumnAggregatorNode(ReteContainer reteContainer, IMultisetAggregationOperator<Domain,Accumulator,AggregateResult> operator, TupleMask groupMask, int aggregatedColumn)
reteContainer
- the RETE container of the nodeoperator
- the aggregation operatorgroupMask
- the mask that masks a tuple to obtain the key that we are grouping-byaggregatedColumn
- the index of the column that the aggregator node is aggregating overpublic boolean isInDRedMode()
RederivableNode
isInDRedMode
in interface RederivableNode
protected Mailbox instantiateMailbox()
SingleInputNode
Mailbox
of this receiver.
Subclasses may override this method to provide their own mailbox implementation.instantiateMailbox
in class SingleInputNode
public TupleMask getCoreMask()
getCoreMask
in interface PosetAwareReceiver
public TupleMask getPosetMask()
getPosetMask
in interface PosetAwareReceiver
public IPosetComparator getPosetComparator()
getPosetComparator
in interface PosetAwareReceiver
public void rederiveOne()
RederivableNode
ReteContainer
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.rederiveOne
in interface RederivableNode
public void updateWithPosetInfo(Direction direction, Tuple update, boolean monotone)
PosetAwareReceiver
updateWithPosetInfo
in interface PosetAwareReceiver
direction
- the direction of the updateupdate
- the update tuplemonotone
- true if the update is monotone, false otherwisepublic void update(Direction direction, Tuple update, Timestamp timestamp)
Receiver
protected void updateDefault(Direction direction, Tuple update, Timestamp timestamp)
protected void updateWithDeleteAndRederive(Direction direction, Tuple update, boolean monotone)
public void clear()
Clearable
protected boolean storeIfNotNeutral(Tuple key, Accumulator accumulator, java.util.Map<Tuple,Accumulator> memory)
public Tuple getAggregateTuple(Tuple group)
getAggregateTuple
in class AbstractColumnAggregatorNode<Domain,Accumulator,AggregateResult>
public AggregateResult getAggregateResult(Tuple group)
getAggregateResult
in class AbstractColumnAggregatorNode<Domain,Accumulator,AggregateResult>
public java.util.Map<AggregateResult,Timeline<Timestamp>> getAggregateResultTimeline(Tuple key)
getAggregateResultTimeline
in class AbstractColumnAggregatorNode<Domain,Accumulator,AggregateResult>
public java.util.Map<Tuple,Timeline<Timestamp>> getAggregateTupleTimeline(Tuple key)
getAggregateTupleTimeline
in class AbstractColumnAggregatorNode<Domain,Accumulator,AggregateResult>
protected Accumulator getMainAccumulator(Tuple key)
protected Accumulator getRederivableAccumulator(Tuple key)
protected Accumulator getAccumulator(Tuple key, java.util.Map<Tuple,Accumulator> memory)
public CommunicationGroup getCurrentGroup()
getCurrentGroup
in interface IGroupable
public void setCurrentGroup(CommunicationGroup currentGroup)
IGroupable
setCurrentGroup
in interface IGroupable