Beliefs, Goals and Events in ASTRA
In terms of beliefs, goals, and events, the main difference is that terms and variables are typed. The type system employed by ASTRA is based on the Java type system – simply because this is the underlying implementation language so adopting a similar type system makes translating between ASTRA and Java simpler and more transparent.
The full list of types is given in the table below.
|int||integer value that maps onto the java.lang.Integer class and the int Java data type.||5, -11, 127|
|long||integer value that maps onto the java.lang.Long class and the long Java data type.||55l, -225l, 12954l|
|float||real value that maps onto the java.lang.Float class and the float Java data type.||12.3f, -4.567f|
|double||real value that maps onto the java.lang.Double class and the double Java data type.||9.876, -1234.5678|
|char||character value that maps onto the java.lang.Character class and the char Java data type.||'a', '3', '@'|
|boolean||boolean value that maps onto the java.lang.Boolean class and the boolean Java data type.||true or false|
|string||string of characters that maps onto the java.lang.String class.||"animal", "feel", "12\t34"|
|list||list of values that maps onto the astra.term.ListTerm class which itself extends java.util.List.||[1, 2, 3, 4], ["the", 4, 'a', true]|
|object||a generic type that can be mapped onto any Java class (e.g. object||cannot be directly represented|
This means that representing the belief that the light is on would be done by a predicate with a string term: light(“on”); or the belief that the agent is alive, could be represented by the predicate: state(“alive”) – note that in both cases, the argument is a string. Similarly, goals in ASTRA are the same as in AgentSpeak, with the exception that all terms must be typed. For example, if you are a soccer playing agent and your team is attacking, then you may have a goal to score. This could be represented by a goal such as: !score(“goal”).
Given all terms must be literals of a valid type, clearly all variables must also be typed. Further, variables can only be associated with values that matches the type of the variable.
Events in ASTRA are again the same as in AgentSpeak(L) with the exception that all terms must be typed. For example, the event that corresponds to the adoption of the belief light(“on”) is +light(“on”) and the event that corresponds to the retraction of that a belief is -light(“on”). Similarly, the event that corresponds to the adoption of the goal !printState(“alive”) is +!printState(“alive”). Further, the triggering events that may be matched against the above events (where variables as used for all terms) would be: +light(string state), -light(string state), and +!printState(string state) respectively. Notice that in these examples, state is a variable.
Finally, ASTRA does also include other event types beyond the ones defined here. These additional event types correspond to message events (receipt of messages), EIS and CArtAgO events (environment events), and ACRE events (conversation management events). This use of an expanded set of event types is one of the distinguishing features of ASTRA when compared with AgentSpeak(L) or Jason.