Basic References for ORA4MAS-NOPL


Contents

Introduction

This document very briefly describes how to use the MOISE platform based on CARTAGO. It follows the new approach to implement OMI (Organisation Management Infrastructure): based on a normative language and artifacts. The conceptual view of this approach is presented in [2], which is strongly based on ORA4MAS [4].

A brief history of MOISE OMIs

Organisational Artifacts Specification

Two kinds of artifacts are implemented: GroupBoard and SchemeBoard. The usage interface (operations, observable properties, and signals) of them are available in the following links

Java integration

There is a generic GUI to create organisational artifact and agents enabling the user to test the specification (it is similar to the SimOE program in S-MOISE+). To run it:

ant run-art

We can then set the organisational specification for the system and create groups, schemes, and generic GUI based agents.

You can also read the code of a simulator to learn how to program Java agents to use these artifacts. The source is available at src/ora4mas/nopl/simulator/ConsoleSimulator.java

Jason Integration

Organisational actions

The actions are the action provided by the OrgArts.

Organisational perception

Observable properties of the artifacts (which are Java objects) are mapped to the beliefs inside agents by Cartago-Jason bridge. All of them are annotated with artifact(artifact id) as shown in the mind inspector:

The beliefs are the following (see API documentation of artifacts for more details):

The following signals are also translated to Jason events (see the organisational artifacts specification for more details):

Example

We use the traditional writing paper example to illustrate the use of Jason - ORA4MAS integration [4]. In this example we have three agents:

The Jason project is:


/* 
  (Traditional) Writing paper example
  
  the platform is ora4mas (based on artifacts)
  
  by Jomi (2010)
*/

MAS wp {

    infrastructure: Centralised

    environment: c4jason.CartagoEnvironment // the environment is cartago

    agents:
        bob   agentArchClass c4jason.CAgentArch; // agents have a customised architecture to use cartago
        alice agentArchClass c4jason.CAgentArch;
        carol agentArchClass c4jason.CAgentArch;

    classpath: "../../../lib/moise.jar";   // moise: where the artifacts are included 
               "../../../lib/cartago.jar"; // cartago: platform for artifacts
               "../../../lib/c4jason.jar"; // jason-cartago integration
}

The code of the agents follows.

Bob


// This agent creates the group/scheme to write a paper
// and adopts the role "editor" in the group

{ include("check_obl.asl") } // some common plans for obedient agents

/* Initial goals */

!start.

/* Plans */

+!start 
  <- .my_name(Me);
     createWorkspace("ora4mas");
     joinWorkspace("ora4mas",O4MWsp);
     
     makeArtifact("mypaper","ora4mas.nopl.GroupBoard",["../wp-os.xml", wpgroup, false, true ],GrArtId);
     focus(GrArtId);
     .print("group created");
	 
     adoptRole(editor)[artifact_id(GrArtId)];
	 
     // wait for alice
     ?play(alice,writer,"mypaper");
     
     // wait for carol
     ?play(carol,writer,"mypaper");
	 
     !run_scheme(sch1).

// general error handler for goal start 
-!start[error(I),error_msg(M)] <- .print("failure in starting! ",I,": ",M).
     
+!run_scheme(S)
   <- makeArtifact(S,"ora4mas.nopl.SchemeBoard",["../wp-os.xml", writePaperSch, false, true ],SchArtId);
      focus(SchArtId);
      .print("scheme ",S," created");
      addScheme(S)[artifact_name("mypaper")]; 
      .print("scheme is linked to responsible group");	 
      commitMission(mManager)[artifact_id(SchArtId)].
-!run_scheme(S)[error(I),error_msg(M)] <- .print("failure creating scheme ",S," -- ",I,": ",M).

// application domain goals
+!wtitle     <- .wait(500); .print("writing title...").
+!wabs       <- .print("writing abstract...").
+!wsectitles <- .print("writing section title...").
+!wconc	     <- .print("writing conclusion...").
+!wp         <- .print("paper finished!").

+goalState("sch1", wp, _, _, satisfied)         
   <- .wait(1000);
      lookupArtifact("sch1",SchId);      
      destroy[artifact_id(SchId)];
      disposeArtifact(SchId);
      .print("starting a new scheme...");
      !run_scheme("sch2").

+?play(A,R,G) <- .wait({+play(_,_,_)},100,_); ?play(A,R,G).
    
// signals
+normFailure(N)  <- .print("norm failure event: ", N).
+destroyed(Art)  <- .print("Artifact ",Art," destroyed").      

// for debug (prints out the new states of goals)
//+goalState(Sch,Goal,CommittedAgs,AchievedBy,State)
//   <- .print("                         goal changed: ", goalState(Sch,Goal,CommittedAgs,AchievedBy,State)).
   

The included file is:

// plans to handle obligations
+obligation(Ag,Norm,committed(Ag,Mission,Scheme),Deadline)
    : .my_name(Ag)
   <- .print("I am obliged to commit to ",Mission," on ",Scheme);
      commitMission(Mission)[artifact_name(Scheme)].
      
+obligation(Ag,Norm,achieved(Scheme,Goal,Ag),Deadline)
    : .my_name(Ag)
   <- .print("I am obliged to achieve goal ",Goal);
      !Goal[scheme(Scheme)];
      goalAchieved(Goal)[artifact_name(Scheme)].
      
+obligation(Ag,Norm,What,Deadline)  
   : .my_name(Ag)
   <- .print("I am obliged to ",What,", but I don't know what to do!").

/* (old plans not used anymore)

//!check_obligations.

// see obligation list, if it is for me and I am not done, obey. Repeat it forever.      
+!check_obligations
    : active_obligations(ListOfObl)[artifact_name(ArtId,ArtName)]
   <- for( .member(Obl,ListOfObl) ) {
         !check_obligation(Obl);
      }
      .wait(200);
      !!check_obligations.
-!check_obligations
   <- .wait(200);
      !!check_obligations.
               
+!check_obligation( obligation(Ag,Norm,committed(Ag,Mission,Scheme),Deadline) )
    : .my_name(Ag)
   <- .print("I am obliged to commit to ",Mission);
      commitMission(Mission)[artifact_name(Scheme)].
      
+!check_obligation( obligation(Ag,Norm,achieved(Scheme,Goal,Ag),Deadline) )
    : .my_name(Ag)
   <- .print("I am obliged to achieve goal ",Goal);
      !Goal[scheme(Scheme)];
      goalAchieved(Goal)[artifact_name(Scheme)].
      
+!check_obligation( obligation(Ag,Norm,What,Deadline) )  
   : .my_name(Ag)
   <- .print("I am obliged to ",What,", but I don't know what to do!").
*/     

Alice


// this agent waits for the group creation and then
// adopts the role write and
// commits to the missions mColaborator and mBib

{ include("common.asl") }
{ include("check_obl.asl") }

/* Initial goals */

/* Plans */

// application domain goals
+!wsecs <- .print("writing sections...").
+!wrefs <- .print("organising bibliography...").

// conditions to leave missions
@lgss1[atomic]
+goalState(Scheme,wsecs,_,_,satisfied)
    : .my_name(Me) & commitment(Me,mColaborator,Scheme)
   <- !quit_mission(mColaborator,Scheme).
      
@lgss2[atomic]
+goalState(Scheme,wrefs,_,_,satisfied)
    : .my_name(Me) & commitment(Me,mBib,Scheme)
   <- !quit_mission(mBib,Scheme).

The common.asl file:

/* Common code for Alice and Carol */

/* useful rules */

/* Initial goals */

!start.
!join.

/* Plans */

+!start 
   <- lookupArtifact("mypaper",GrId); 
      adoptRole(writer)[artifact_id(GrId)];
      focus(GrId).     
-!start
   <- .wait(100);
      !start.
	 
+!join 
   <- .my_name(Me); 
       joinWorkspace("ora4mas",_).
-!join
   <- .wait(200);
      !!join.
      
// keep focused on schemes my groups are responsible for
+schemes(L)
   <- for ( .member(S,L) ) {
         lookupArtifact(S,ArtId);
         focus(ArtId)
      }.
      
+!quit_mission(M,S)
   <- .print("leaving my mission ",M," on ",S,"....");
      leaveMission(M)[artifact_name(S)].            
              

Carol


// this agent waits for the group creation and then
// adopts the role write and
// commits to the mission mColaborator

{ include("common.asl") }

/* Initial goals */

/* Plans */

// application domain goals
+!wsecs[scheme(S)]
   <- .print("writing sections for scheme ",S,"...").

// when my goal in the scheme is satisfied, leave my mission 
@lqm[atomic]
+goalState(Scheme,wsecs,_,_,satisfied)
    : .my_name(Me) & commitment(Me,mColaborator,Scheme)
   <- !quit_mission(mColaborator, Scheme).

// plans to handle obligations
+obligation(Ag,Norm,committed(Ag,mColaborator,Scheme),DeadLine)
    : .my_name(Ag)
   <- .print("I am obliged to commit to ",mColaborator);
      commitMission(mColaborator)[artifact_name(Scheme)].
      
+obligation(Ag,Norm,achieved(Scheme,Goal,Ag),DeadLine)
    : .my_name(Ag)
   <- .print("I am obliged to achieve goal ",Goal);
      !Goal[scheme(Scheme)];
      goalAchieved(Goal)[artifact_name(Scheme)].
               

Bibliography

1
Benjamin Gâteau, Olivier Boissier, Djamel Khadraoui, and Eric Dubois.
Controlling an interactive game with a multi-agent based normative organisational model.
In P. Noriega, J. Vázquez-Salceda, G. Boella, V. Boissier, O.; Dignum, N. Fornara, and E. Matson, editors, AAMAS 2006 and ECAI 2006 International Workshops, COIN 2006 Hakodate, Japan, May 9, 2006 Riva del Garda, Italy, August 28, 2006, volume 4386 of LNAI, pages 86-100. Springer, 2007.
Revised Selected Papers.

2
Jomi F. Hübner, Olivier Boissier, and Rafael H. Bordini.
Normative programming for organisation management infrastructures.
In Axel Polleres and Julian Padget, editors, Workshop on Coordination, Organization, Institutions and Norms in agent systems (COIN09@MALLOW) Torino, Italy, 7th-11th September, volume 494. CEUR, 2009.

3
Jomi Fred Hübner, Olivier Boissier, and Rafael H. Bordini.
A normative organisation programming language for organisation management infrastructures.
In Julian Padget et al., editor, Coordination, Organizations, Institutions and Norms in Agent Systems V, volume 6069 of LNAI, pages 114-129. Springer, 2010.

4
Jomi Fred Hübner, Olivier Boissier, Rosine Kitio, and Alessandro Ricci.
Instrumenting multi-agent organisations with organisational artifacts and agents: ``giving the organisational power back to the agents''.
Journal of Autonomous Agents and Multi-Agent Systems, 20(3):369-400, May 2010.

5
Jomi Fred Hübner, Jaime Simão Sichman, and Olivier Boissier.
S-MOISE+: A middleware for developing organised multi-agent systems.
In Olivier Boissier, Virginia Dignum, Eric Matson, and Jaime Simão Sichman, editors, Coordination, Organizations, Institutions, and Norms in Multi-Agent Systems, volume 3913 of LNCS, pages 64-78. Springer, 2006.

6
Jomi Fred Hübner, Jaime Simão Sichman, and Olivier Boissier.
Developing organised multi-agent systems using the MOISE+ model: Programming issues at the system and agent levels.
International Journal of Agent-Oriented Software Engineering, 1(3/4):370-395, 2007.