Class BetaNode
- java.lang.Object
-
- jadex.rules.rulesystem.rete.nodes.AbstractNode
-
- jadex.rules.rulesystem.rete.nodes.AbstractBetaNode
-
- jadex.rules.rulesystem.rete.nodes.BetaNode
-
- All Implemented Interfaces:
INode
,IObjectConsumerNode
,ITupleConsumerNode
,ITupleSourceNode
,java.lang.Cloneable
public class BetaNode extends AbstractBetaNode
A beta node has the purpose to perform a constraints check between (at least) two objects. The beta node has to incoming coming connections which both can activate the node.
-
-
Field Summary
-
Fields inherited from class jadex.rules.rulesystem.rete.nodes.AbstractBetaNode
evaluators, indexers, indirects, osource, relevants, tconsumers, tsource
-
Fields inherited from class jadex.rules.rulesystem.rete.nodes.AbstractNode
clones, nodeid
-
-
Constructor Summary
Constructors Constructor Description BetaNode(int nodeid, IConstraintEvaluator[] evaluators, ConstraintIndexer[] xevaluators)
Create a new beta node.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addMatch(Tuple left, java.lang.Object right, IOAVState state, ReteMemory mem, AbstractAgenda agenda)
Add a match to the node memory and propagate if necessary.boolean
checkNodeConsistency(ReteMemory mem)
Check the consistency of the node.protected boolean
isMatchContained(IOAVState state, Tuple left, java.lang.Object right, ReteMemory mem)
Check if a match is contained.void
modifyObject(java.lang.Object right, OAVAttributeType type, java.lang.Object oldvalue, java.lang.Object newvalue, IOAVState state, ReteMemory mem, AbstractAgenda agenda)
Propagate an object change to this node.void
modifyTuple(Tuple left, int tupleindex, OAVAttributeType type, java.lang.Object oldvalue, java.lang.Object newvalue, IOAVState state, ReteMemory mem, AbstractAgenda agenda)
Modify a tuple in this node.protected void
propagateModification(Tuple left, java.lang.Object right, int tupleindex, OAVAttributeType type, java.lang.Object oldvalue, java.lang.Object newvalue, IOAVState state, ReteMemory mem, AbstractAgenda agenda)
Propagate a change of a tuple in the result memory.protected void
removeMatch(Tuple left, java.lang.Object right, IOAVState state, ReteMemory mem, AbstractAgenda agenda)
Remove a match from the node memory and propagate if necessary.-
Methods inherited from class jadex.rules.rulesystem.rete.nodes.AbstractBetaNode
addObject, addTuple, addTupleConsumer, checkNonindexedConstraints, createNodeMemory, doClone, fetchObjectMemory, fetchTupleMemory, getConstraintEvaluators, getConstraintIndexers, getIndirectAttributes, getNodeMemory, getObjectSource, getRelevantAttributes, getTupleConsumers, getTupleSource, identityIntersection, intersection, isAffected, modifyIndirectObject, removeObject, removeTuple, removeTupleConsumer, setObjectSource, setTupleSource
-
Methods inherited from class jadex.rules.rulesystem.rete.nodes.AbstractNode
clone, equals, getNodeId, hashCode, toString, toString
-
-
-
-
Constructor Detail
-
BetaNode
public BetaNode(int nodeid, IConstraintEvaluator[] evaluators, ConstraintIndexer[] xevaluators)
Create a new beta node.
-
-
Method Detail
-
modifyTuple
public void modifyTuple(Tuple left, int tupleindex, OAVAttributeType type, java.lang.Object oldvalue, java.lang.Object newvalue, IOAVState state, ReteMemory mem, AbstractAgenda agenda)
Modify a tuple in this node.- Specified by:
modifyTuple
in interfaceITupleConsumerNode
- Overrides:
modifyTuple
in classAbstractBetaNode
- Parameters:
left
- The tuple.
-
modifyObject
public void modifyObject(java.lang.Object right, OAVAttributeType type, java.lang.Object oldvalue, java.lang.Object newvalue, IOAVState state, ReteMemory mem, AbstractAgenda agenda)
Propagate an object change to this node.- Specified by:
modifyObject
in interfaceIObjectConsumerNode
- Overrides:
modifyObject
in classAbstractBetaNode
- Parameters:
right
- The new object.
-
addMatch
protected void addMatch(Tuple left, java.lang.Object right, IOAVState state, ReteMemory mem, AbstractAgenda agenda)
Add a match to the node memory and propagate if necessary.- Specified by:
addMatch
in classAbstractBetaNode
-
removeMatch
protected void removeMatch(Tuple left, java.lang.Object right, IOAVState state, ReteMemory mem, AbstractAgenda agenda)
Remove a match from the node memory and propagate if necessary.- Specified by:
removeMatch
in classAbstractBetaNode
-
propagateModification
protected void propagateModification(Tuple left, java.lang.Object right, int tupleindex, OAVAttributeType type, java.lang.Object oldvalue, java.lang.Object newvalue, IOAVState state, ReteMemory mem, AbstractAgenda agenda)
Propagate a change of a tuple in the result memory.- Specified by:
propagateModification
in classAbstractBetaNode
-
isMatchContained
protected boolean isMatchContained(IOAVState state, Tuple left, java.lang.Object right, ReteMemory mem)
Check if a match is contained.- Specified by:
isMatchContained
in classAbstractBetaNode
-
checkNodeConsistency
public boolean checkNodeConsistency(ReteMemory mem)
Check the consistency of the node.- Specified by:
checkNodeConsistency
in interfaceINode
- Overrides:
checkNodeConsistency
in classAbstractNode
-
-