public class PerceptionMessage extends Message implements HasTarget
Gained and lost objects are each described by an PerceptionMessage.ObjectNote
.
The ObjectNote contains the object OID (subject) and object type.
The ObjectNote may optionally contain some
arbitrary object information (see PerceptionMessage.ObjectNote.getObjectInfo()
).
ObjectNote supports a different target for each perceived object, but this capability is currently not used and may become deprecated.
Modifier and Type | Class and Description |
---|---|
static class |
PerceptionMessage.ObjectNote
Described a gained or lost perceivable object.
|
Constructor and Description |
---|
PerceptionMessage()
No-arg constructor required for marshalling.
|
PerceptionMessage(MessageType msgType)
Create message of the given message type.
|
PerceptionMessage(MessageType msgType,
OID target)
Create message of the given message type and target.
|
Modifier and Type | Method and Description |
---|---|
PerceptionMessage.ObjectNote |
gainObject(OID targetOid,
OID subjectOid,
ObjectType objectType)
Add a gained object.
|
void |
gainObject(PerceptionMessage.ObjectNote note)
Add a gained object.
|
int |
getGainObjectCount()
Get number of gained objects.
|
java.util.List<PerceptionMessage.ObjectNote> |
getGainObjects()
Get gained object list.
|
int |
getLostObjectCount()
Get number of lost objects.
|
java.util.List<PerceptionMessage.ObjectNote> |
getLostObjects()
Get lost object list.
|
OID |
getTarget()
Get the message target.
|
void |
lostObject(OID targetOid,
OID subjectOid)
Add a lost object.
|
void |
lostObject(OID targetOid,
OID subjectOid,
ObjectType objectType)
Add a lost object.
|
void |
lostObject(PerceptionMessage.ObjectNote note)
Add a lost object.
|
void |
setTarget(OID target)
Set the message target OID.
|
getEnqueueTime, getMsgId, getMsgInstanceOid, getMsgType, getSenderName, isRPC, setEnqueueTime, setEnqueueTime, setMsgInstanceOid, setMsgType, toBytes, ToString
public PerceptionMessage()
public PerceptionMessage(MessageType msgType)
public PerceptionMessage(MessageType msgType, OID target)
public OID getTarget()
public void setTarget(OID target)
public PerceptionMessage.ObjectNote gainObject(OID targetOid, OID subjectOid, ObjectType objectType)
public void gainObject(PerceptionMessage.ObjectNote note)
public void lostObject(OID targetOid, OID subjectOid, ObjectType objectType)
public void lostObject(PerceptionMessage.ObjectNote note)
public java.util.List<PerceptionMessage.ObjectNote> getGainObjects()
public java.util.List<PerceptionMessage.ObjectNote> getLostObjects()
public int getGainObjectCount()
public int getLostObjectCount()