Atavism Version 2018.1AGIS API

atavism.server.messages
Class PerceptionTrigger

java.lang.Object
  extended by atavism.msgsys.MessageTrigger
      extended by atavism.server.messages.PerceptionTrigger

public class PerceptionTrigger
extends MessageTrigger

Track union of perceived objects. This trigger only works with 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.


Nested Class Summary
protected  class PerceptionTrigger.IntHolder
           
 
Constructor Summary
PerceptionTrigger()
          No-arg constructor required for marshalling.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PerceptionTrigger

public PerceptionTrigger()
No-arg constructor required for marshalling.

Method Detail

setFilter

public void setFilter(IFilter filter)
Set the trigger's filter.

Specified by:
setFilter in class MessageTrigger

setTriggeringTypes

public void setTriggeringTypes(java.util.Collection<MessageType> types)
Set the message types that run the trigger.


match

public boolean match(Message message)
True if the trigger should run for the message. Compares the message type to the triggering types. If no triggering types are set (the default) then returns true if message is a PerceptionMessage.

Overrides:
match in class MessageTrigger

trigger

public void trigger(Message triggeringMessage,
                    IFilter triggeringFilter,
                    MessageAgent agent)
Track union of perceived objects and keep filter in-sync. The filter must be a PerceptionFilter and the message must be a PerceptionMessage.

Specified by:
trigger in class MessageTrigger
Parameters:
triggeringMessage - The matched message.
triggeringFilter - The matched filter.
agent - The local message agent.


Copyright © 2018 Dragonsan Studios Sp. z o.o.