23.08.2015 Views

Here - Agents Lab - University of Nottingham

Here - Agents Lab - University of Nottingham

Here - Agents Lab - University of Nottingham

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ERESYE [15] (ERlang Expert SYstem Engine) to implement the belief base <strong>of</strong>each agent. ERESYE is a library to write expert systems and rule processingengines using the Erlang programming language. It allows to create multipleengines, each one with its own facts and rules to be processed. We decided touse this s<strong>of</strong>tware as the term storage service due to its capabilities to store Erlangterms and to also retrieve them using pattern matching. Nevertheless, dueto the way in which we used this s<strong>of</strong>tware, the resulting Jason implementationwas rather inefficient. Therefore we decided to implement our own belief base.This later implementation represents the belief base <strong>of</strong> each agent as a list <strong>of</strong>ground terms. The translation <strong>of</strong> beliefs, goals and rules to Erlang is explainedin Sect. 3.3The implementation <strong>of</strong> plans is more convoluted due to their dynamic nature.Every plan is composed by one or more formulas that must be evaluatedsequentially. However, the formulas in a plan may not all be executable in thesame reasoning cycle. The representation <strong>of</strong> plans in Erlang, and their executionby a tail-recursive Erlang function, is explained in Sect. 3.4.A higher-level view <strong>of</strong> the different Erlang processes implementing the Jasonreasoning cycle [9] and the communication between them is described in Sect. 3.5,while Sect. 3.6 provides the details. Basically, the reasoning cycle <strong>of</strong> each agentis handled by a different Erlang process.Finally Sect. 3.7 enumerates the limitations <strong>of</strong> eJason, with respect to implementingthe full Jason language, at the time <strong>of</strong> writing this paper.3.3 Translation <strong>of</strong> Jason beliefs and goals into Erlang<strong>Here</strong> we describe how the different constructs for representing and inferringknowledge <strong>of</strong> Jason are implemented.Variables. To represent the bound and unbound variables <strong>of</strong> a plan we use avariable valuation that is updated as variables become bound to values. Concretely,a valuation for a plan is represented by an Erlang tuple where values areassociated with distinct variables ordered according to the order in which thesevariables first occur in the plan. For instance, a possible valuation for the secondplan (f) in Fig. 2 would be {0, 2000, ’_’}, thus binding X to 0, Y to 2000 andleaving NewCount unbound.Beliefs. Every agent possesses its own belief base, i.e., each agent can only accessand update its own belief base. In a first version <strong>of</strong> eJason, we used ERESYE inthe following manner. Each agent ran its own ERESYE engine, which spawnedthree Erlang processes for each belief base. Early experiments showed that thisimplementation was rather inefficient. For instance, the eJason implementation<strong>of</strong> the counter example could only handle around four thousand agents. Analternative is to use a single ERESYE engine for all agents, and provide somemeans to isolate the beliefs <strong>of</strong> each agent from everyone else’s. We discardedthis approach because the autonomy <strong>of</strong> agents would have been compromised.12

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!