public class PerceptionTrigger extends MessageTrigger
PerceptionFilter and PerceptionMessage. By default,
match() returns true for any instance of PerceptionMessage.
The trigger tracks the union of objects perceived by the filter's target OIDs. The filter subject OIDs are kept in-sync with this union.
| Modifier and Type | Class and Description |
|---|---|
protected class |
PerceptionTrigger.IntHolder |
| Constructor and Description |
|---|
PerceptionTrigger()
No-arg constructor required for marshalling.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
match(Message message)
True if the trigger should run for the message.
|
void |
setFilter(IFilter filter)
Set the trigger's filter.
|
void |
setTriggeringTypes(java.util.Collection<MessageType> types)
Set the message types that run the trigger.
|
void |
trigger(Message triggeringMessage,
IFilter triggeringFilter,
MessageAgent agent)
Track union of perceived objects and keep filter in-sync.
|
public PerceptionTrigger()
public void setFilter(IFilter filter)
setFilter in class MessageTriggerpublic void setTriggeringTypes(java.util.Collection<MessageType> types)
public boolean match(Message message)
message type to the triggering types. If no
triggering types are set (the default) then returns true
if message is a PerceptionMessage.match in class MessageTriggerpublic void trigger(Message triggeringMessage, IFilter triggeringFilter, MessageAgent agent)
PerceptionFilter and the
message must be a PerceptionMessage.trigger in class MessageTriggertriggeringMessage - The matched message.triggeringFilter - The matched filter.agent - The local message agent.