ALTISSIMO School - OOP 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.
- switch your Eclipse (already configured with JaCaMo plug-in) to that workspace
- be sure to have configured JaCaMo on the system
A first Agents Organization
- In order to install some coordination, let's use an organization which provides us with the right mean to install an explicit and adaptable coordination pattern.
- The org-spec.xml file contains the definition of an organization specification based on the MOISE organization language.
- This is a very first organization structural and functional specifications assigning goals to agents (one role, mission/goal and norm) so that a set of agents is in charge of observing, another set in charge of computing, another set in charge of printing messages). This specification is a follows:
- Structural specification:
- one group type: easssGr
- possible roles are: greeter, observer, computer
- Functional specification:
- possible goals are compute, greeting, observe,
- missions are mCompute, mGreeting, mObserve
- Normative specification is straightforward: permissions for each role, each mission
Exercise: Organized world of interacting Agents and Artifacts
- Consider the code available in step9.
- Define a group of three to four students. Each group launches only one MAS server. Each user launches a MAS client.
- Use the GUI Artifact in your MAS client and try to enter the organization following the dynamic of the organization as defined in MOISE metamodel (cf. course). Thanks to the GUI Artifact, you can decide to adopt a role, to commit to a mission, to declare the achievement of some goal
- Look at the execution using either the agent's mind inspector, the organization inspector checking the state of each of the organizational artifacts (groupboard and schemeboard), detect the violations
- Describe the global life cycle of the organization? What are the different steps to follow before executing a social scheme?
Mastering the building of an organization
Exercise: Changing the Organization Specification
- Change the specification of the organisation (e.g. cardinality of roles, order of the goals, …) and see how it changes the functionning of the agents
- Modify the organisation specification in order to force to have at least two agents playing the role greeter in the group.
- Modify the organisation specification so that the role greeter is obliged to commit to mission mCompute (after testing, undo your change)
Organization-Aware Agents: reasoning on the organization
- We will reuse the previous example and will automate some of the actions for creating/instantiating the organisation.
- You could have a look at the way the deployement of the organisation management infrastructure is done in the MAS server by looking at the code of the (org_majordomo) agent
Exercise: Adopting a role
- Choose a role to be adopted by your agent
- Add in your code the plan so that your agent adopts the chosen role as soon as the group has been created (i.e. the corresponding groupBoard artifact has been deployed)
- Add in your code the plan so that your agent leaves its current role as soon as another agent adopts the same role in his/her group and the group is not yet well formed. After leaving the agent adopts another role.
Exercise: Making a group responsible of a social scheme
- Make your group responsible of the social scheme deployed in the schemeBoard artifact, as soon as the group is well formed.
- From that time, agents that are playing roles in the group, have the possibility to execute the missions of the scheme under the responsibility of the group.
How to test the status of a group
- As soon as the group is well formed, a new belief formationStatus is generated into the agent's belief base
Organization-Aware Agents : reasoning on the obligations
Exercise: Making an obedient agent
- Add a plan in the agent's code so that this agent becomes an obedient one: as soon as one obligation, that concerns it, is created, the agent fulfills the obligation
What does it mean to fulfill an obligation
- fulfilling an obligation for a mission means committing to that mission
- fulfilling an obligation for a goal means achieving that goal
Exercise: Managing reputation of an agent
- Add a plan in the agent's code so that each time an agent of its group fulfills an obligation, it broadcasts a message in order to increase the reputation of that agent
How to know that an obligation has been fulfilled
- as soon as an obligation is fulfilled, the signal oblFulfilled is generated by the artifacts