For instance, a failure in the ERESYE engine would cause a failure in the beliefbase <strong>of</strong> all agents. Therefore, we decided to implement our own belief base ina separate module, named beliefbase, which provides the functionality to accessand update a belief base without having to create a separate Erlang process. Asexplained earlier, this belief base is represented as a list <strong>of</strong> Erlang terms, whereeach term in the list corresponds to a different belief.A belief, i.e., either an atom or a ground formula, is represented in eJason asan Erlang tuple. An atom belief is represented in Erlang as the tuple containingthe atom belief itself, e.g., {atom belief }. A ground formula belief is representedby an Erlang tuple with three elements. The first element is the name <strong>of</strong> thepredicate, the second is a tuple which enumerates the arguments <strong>of</strong> the predicate,and the third is a list containing a set <strong>of</strong> annotations. Each annotation can eitherbe an atom or a predicate and is represented in the same manner as a belief. Asan example, the belief base <strong>of</strong> the running example (with an added annotation):init_count(0).max_count(2000)[source(self)].is translated to the following Erlang term:{ init_count, {0}, [] }.{ max_count, {2000}, [ {source,{self},[]} ] }.Rules. Each rule in Jason is represented as an Erlang function. This function,when provided with the proper number <strong>of</strong> input parameters, accesses the belief,if necessary, and returns the list <strong>of</strong> all the terms that both satisfy the rule andmatch the input pattern.Goals. Goals are represented in the same way as beliefs. Nevertheless, they arenever stored in isolation, but as part <strong>of</strong> the body <strong>of</strong> an event, as specified below.Events. As we have not yet implemented perception <strong>of</strong> the agent environment,events always correspond to the explicit addition or deletion <strong>of</strong> beliefs, or theinclusion <strong>of</strong> achievement and test goals. An event is composed <strong>of</strong> an event body,an event type, and a related intention. The event body is a tuple that containstwo elements. The first element is one <strong>of</strong> the atoms {added belief, removed belief,added achievement goal, added test goal}. The second element is a tuple thatrepresents the goal or belief whose addition or deletion generated the event. Theevent type is either the atom internal or the atom external, with the obviousmeaning. The related intention is either a tuple, as described below, or the atomundefined to state that the event has no related intention. The only internalevents that possess a related intention are the events corresponding to the addition<strong>of</strong> goals, as their intended means will be put on top <strong>of</strong> that intention.The intended means for the rest <strong>of</strong> events will <strong>of</strong>ten generate new intentions.When a relevant plan for the event is selected, the list <strong>of</strong> Erlang functions that13
execute the formulas in its body is added either on top <strong>of</strong> a related intentionor as a brand new intention (e.g. in the case <strong>of</strong> external events). For instance,consider the following formulas in the body <strong>of</strong> a plan belonging to some intentionIntention:+actual_count(NewCount);?next(X, NewCount);The events generated after their respective execution would be:{event, internal, {added_belief,{actual_count,{NewCount}, []} }, undefined }{event, internal, {added_test_goal,{next, {X, NewCount}, []} }, Intention}For the sake <strong>of</strong> clarity, the variable Intention appears as placeholder for the realrepresentation <strong>of</strong> the corresponding related intention.3.4 Implementing Jason plans in ErlangBody <strong>of</strong> a plan. Every Jason plan is composed by one or more formulas thatmust be evaluated in a sequence. However, these formulas are not all necessarilyevaluated during the same reasoning cycle <strong>of</strong> the agent, e.g., due to the presence<strong>of</strong> a subgoal that must be resolved by another plan. To be able to execute theformulas separately, each formula is implemented by a different Erlang function.Then, the representation <strong>of</strong> the body <strong>of</strong> a Jason plan is a list <strong>of</strong> Erlang functions.Each <strong>of</strong> these functions implements the behaviour <strong>of</strong> a different formula from theJason plan. The order <strong>of</strong> these functions in the list is the same order <strong>of</strong> the bodyformulas they represent. The implementation and processing <strong>of</strong> the formulas ina plan body is the most intricate task in the implementation <strong>of</strong> Jason in Erlang.Plans. A Jason plan is represented by a record having three components: atrigger, a context and body. The trigger element is a function which, applied tothe body <strong>of</strong> an event, returns either the atom false if the plan does not belongto the set <strong>of</strong> relevant plans for the event or the tuple {true,InitialValuation},where InitialValuation provides the bindings for the variables in the trigger. Thecontext is a function which, when applied to the initial valuation obtained fromthe trigger, returns a list <strong>of</strong> all the possible valuations for the variables in thetrigger and context that satisfy the context. Finally, the body element is the list<strong>of</strong> Erlang functions that implement the body <strong>of</strong> the plan, as described before.As an example, consider the plan for agent counter:+!startcount : init_count(X)
- Page 2 and 3: Proceedings of the Tenth Internatio
- Page 4 and 5: OrganisationOrganising CommitteeMeh
- Page 6: Table of ContentseJason: an impleme
- Page 10 and 11: in Sect. 3 the translation of the J
- Page 12 and 13: init_count(0).max_count(2000).(a)(b
- Page 16 and 17: {plan, fun start_count_trigger/1,fu
- Page 18 and 19: single parameter, an Erlang record
- Page 20 and 21: 1. Belief annotations. Even though
- Page 22 and 23: decisions taken during the design a
- Page 24 and 25: Conceptual Integration of Agents wi
- Page 26 and 27: Fig. 2. Active component structurep
- Page 28 and 29: the service provider component. As
- Page 30 and 31: Fig. 4. Web Service Invocationretri
- Page 32 and 33: 01: public interface IBankingServic
- Page 34 and 35: tate them in the same way as in the
- Page 36 and 37: 01: public interface IChartService
- Page 38 and 39: implementations being available for
- Page 41: deliberative behavior in BDI archit
- Page 44 and 45: layer modules (i.e. nodes) can be d
- Page 46 and 47: different methods to choose the cur
- Page 48 and 49: also a single scheduler module, imp
- Page 50 and 51: andom choice (OR), conditional choi
- Page 52 and 53: - Dealing with conflicts based on p
- Page 54 and 55: 5. Brooks, R. A. (1991) Intelligenc
- Page 56 and 57: An Agent-Based Cognitive Robot Arch
- Page 58 and 59: It has been argued that building ro
- Page 60 and 61: EnvironmentHardwareLocal SoftwareC+
- Page 62 and 63: a cognitive layer can connect as a
- Page 64 and 65:
can reliably be differentiated and
- Page 66 and 67:
4 ExperimentTo evaluate the feasibi
- Page 68 and 69:
learn or gain knowledge from experi
- Page 70 and 71:
A Programming Framework for Multi-A
- Page 72 and 73:
exchange and storage of tuples (key
- Page 74 and 75:
Although some success [13] [14] hav
- Page 76 and 77:
as well as important non-functional
- Page 78 and 79:
component plans have been instantia
- Page 80 and 81:
A in the example) can evaluate all
- Page 83 and 84:
1. robot-1 issues a Localization(ro
- Page 85 and 86:
ACKNOWLEDGMENTThis work has been su
- Page 87 and 88:
The code was analysed both objectiv
- Page 89 and 90:
a conversation is following. Additi
- Page 91 and 92:
the context of a communication-heav
- Page 93 and 94:
Table 1. Core Agent ProtocolsAgent
- Page 95 and 96:
statistically significant using an
- Page 97 and 98:
to the conversation and has a perfo
- Page 99 and 100:
principal reasons. Firstly, it is a
- Page 101 and 102:
2. Muldoon, C., O’Hare, G.M.P., C
- Page 103 and 104:
In the following section we will at
- Page 105 and 106:
DevelopmentProductionHuman Readabil
- Page 107 and 108:
will then evaluate this new format
- Page 109 and 110:
encoder, it is first checked if the
- Page 111 and 112:
nents themselves. However, since th
- Page 113 and 114:
optimized for this format feature s
- Page 115 and 116:
Java serialization and Jadex Binary
- Page 117 and 118:
10. P. Hoffman and F. Yergeau, “U
- Page 119 and 120:
Caching the results of previous que
- Page 121 and 122:
querying an agent’s beliefs and g
- Page 123 and 124:
or relative performance of each pla
- Page 125 and 126:
were run for 1.5 minutes; 1.5 minut
- Page 127 and 128:
Size N K n p c qry U c upd Update c
- Page 129 and 130:
epresentation. The cache simply act
- Page 131 and 132:
6 ConclusionWe presented an abstrac
- Page 133 and 134:
Typing Multi-Agent Programs in simp
- Page 135 and 136:
1 // agent ag02 iterations (" zero
- Page 137 and 138:
3.1 simpAL OverviewThe main inspira
- Page 139 and 140:
3.2 Typing Agents with Tasks and Ro
- Page 141 and 142:
Defining Agent Scripts in simpAL (F
- Page 143 and 144:
that sends a message to the receive
- Page 145 and 146:
* error: wrong type for the param v
- Page 147 and 148:
Given an organization model, it is
- Page 149 and 150:
Learning to Improve Agent Behaviour
- Page 151 and 152:
2.1 Agent Programming LanguagesAgen
- Page 153 and 154:
choosing actions is to find a good
- Page 155 and 156:
1 init module {2 knowledge{3 block(
- Page 157 and 158:
of a module. For example, to change
- Page 159 and 160:
if bel(on(X,Y), clear(X)), a-goal(c
- Page 161 and 162:
mance. Figure 2d shows the same A f
- Page 163 and 164:
the current percepts of the agent.
- Page 165:
Author IndexAbdel-Naby, S., 69Alelc