ALTISSIMO School - EOP Lab

Notes about the work-in-lab session related to Environment-Oriented Programming in ALTISSIMO. JaCaMo is used as concrete platform to run the examples. In these examples, only the JaCa (Jason+CArtAgO) part is exploited.

Before starting:


STEP 1

Joining workspaces and using Artifacts

The MAS is composed by two CArtAgO (JaCaMo) nodes :

step1.png

Exercises

Highlights


STEP 2

Observing Artifacts

To simplify the deployment, we go on with a single node  (run by main.cfg). In this step:

step2.png

Exercises

Highlights


STEP 3

Computing with Artifacts

step3.png

Exercises

Highlights


STEP 4

Modularisation

With the previous implementation, we had a monolithic env artifact. This is not a good design: we decompose it into multiple artifacts (types and instances), each encapsulating some functionality:

On the agent side:

step4.png

Highlights


STEP 5

Interacting with the external world by means of artifacts

Artifacts can be used to represent (and interact with) external resource, services, functionalities. In this step we add two artifacts:

The MAS is composed by

step5.png        

Exercises

Highlights


STEP 6

Coordination with the help of the artifact

A typical use of artifacts is for coordination. In this step three user agents share and concurrently use the message board, however they want to print some sequence of messages in a critical section, without interleaving the messages of other agents.

To that purpose, a Token artifact - similar to locks in concurrent programming - is provided, with acquire and release operations

step6.png

Exercise

Highlights


STEP 7

Coordination again by the way of artifact

Besides mutual exclusion, synchronization of actions is the kind of coordination that we can obtain using artifacts.

In this step three user agents want to synchronize after printing a first sequence of message, and before printing a further sequence of action.

To that purpose, a Barrier artifact - similar to barriers in concurrent programming - is provided, with a sync operations

step7.png

Exercise

Highlights