What you’ll build |
The aim is to understand and program some basic mechanisms for agent-centric coordination. These mechanisms aim at enabling agents to build an house in a dynamic environment. You will program this multi-agent system, situated in a simple environment. |
What you’ll need |
|
Code |
You can download the initial code from here. |
Collapsible sections introduced by present details or questions and exercises to realise. Think to click on the icon to access to the content. |
This practical work has questions and practical exercises. You are requested to provide the answers to questions Q1, Q2 and Q3 in one single file with your name. You are requested to provide the code for practical exercises PW2 and PW3. The answers and these codes have to be submitted by 12th of November on ecampus web page of the course. Answers and code of the practical exercises are taken into account for the grade. |
1. Preamble
1.1. Problem description
The domain that we are considering concerns a strongly simplified multi-agent based support system for building an house. We envision the use of multiple agents in two main phases:
-
Contracting phase where agents support the contracting of specialized companies. Various companies, specialized in different tasks for the building of an house, participate to a coordinated distributed task allocation process ;
-
Execution phase where agents support the coordination of the companies in the execution of tasks for the building of the house. Contractees participate to the main workflow for building the house under supervision of the house owner.
Detail of the contracting phase
The objective here is to hire one company for each of the following tasks:
-
Preparation of the site (a)
-
Laying of the floors (b)
-
Building the walls of the house (c)
-
Building the roof (d)
-
Fitting the windows (e)
-
Fitting the doors (f)
-
Installing the plumbing (g)
-
Installing the electrical system (h)
-
Painting the exterior of the house (i)
-
Painting the interior of the house (j)
Some of the candidate companies may have the skills for executing several tasks. That is to say that the same company can be hired for more than one task.
Detail of the execution phase for building the house
-
After the companies have been hired, they have to execute their tasks on time and in coordination with each other
-
Some tasks depend on others and some tasks can be done in parallel, as represented for instance by the following workflow (";" for sequence and "|" for parallel):
a ; b ; c ; (d | e | f) ; (g | h | i) ; j
This is one example of a possible workflow. Other workflows could be defined depending on the constraints.
1.2. Initial Implementation
In the initial implementation that you can download, two families of agents are defined:
-
One agent (
giacomo
of typeowner
) supporting the house owner: this agent manages the contracting and building phases considering the requirements for the house, budget limitations and preferences of the owner ; -
One agent (
companyXi
of typecompanyX
) for each company: this agent participates to the contracting by offering the services of the company given its competences and preferences. If hired by the house owner, this agent then manages the execution of the house building tasks for which the company has been contracted.
Two main artifacts are defined: (i) an auction artifact and (ii) an artifact for the simulated house. They are programmed and deployed in the shared environment to support respectively:
-
the auction mechanism used to hire the companies by managing the execution of an electronic auction mechanism ;
-
the actions of the agents on a simulated house to replicate in the digital world the action of the company in the physical world.
An organisation is defined to specify the structure and workflow to be followed by the different companies for the building of the house. This organisation aims at ensuring cooperation in the execution of the global building of the house.
The code and the execution of the multi-agent system is structured along the two main phases: (1) contracting phase and (2) execution phase.
Detail of the contracting phase (click on to access the detail)
-
On the environment’s side, the electronic auction mechanism is implemented by the
AuctionArt
artifact. It is used to hire the required companies as follows:-
One auction for each task (i.e. one instance of
AuctionArt
for each task). -
Each auction is started (i.e. the instance of
AuctionArt
is created) with:-
the task description
-
the maximum value the owner can pay for it
-
-
By the end of an auction, the company to be hired for that task is determined
-
The
AuctionArt
has the following observable properties:-
task
initialized with the task description -
maxValue
initialized with the maximum value -
currentBid
initialized with the maximum value and showing the current best bid -
currentWinner
initialized with"no_winner"
value
-
-
It has the following operation:
-
bid
used with onedouble
parameter for the bidding on the task
-
-
-
On the agent’s side,
-
the
giacomo
agent of typeowner
has plans to launch all auctions by creating the corresponding artifacts of typeAuctionArt
-
the
company
agents of typecompanyX
(X=A,B,C,D or E) have plans to look for the auction artifacts of their interest and plans defining their own bidding strategy -
After some time
giacomo
looks at the best bid in each auction artifact and awards a contract for the winning company
-
Detail of the execution phase (click on to access the detail)
-
After all auctions are over,
giacomo
sends messages to the hired companies to enter into the execution phase by adopting the corresponding roles in the organisation-
An organisation entity is created from the
house-os.xml
organisation specification -
the functional specification is used to define the workflow
-
the structural specification is used to define the role and group structures
-
the normative specification is used to distribute the tasks of the workflow to the roles
-
By playing roles in the organisation entity, the agents will receive obligations on the tasks to realize at the right time
-
-
On the agent’s side,
-
the
giacomo
agent is equipped with the plans to construct the virtual organisation based on the result of the contracting phase -
the
company
agents have plans-
to enter the organisation, adopt the role corresponding to their contract and to catch the different events generated by the organisation management infrastructure
-
to execute autonomously the various actions achieving the goals related to the missions they are committed to in the organisation functional specification
-
-
NB: agents are benevolent with respect to the organisation, i.e. they don’t violate the norms and execute what is prescribed by the organisation
-
-
On the environment’s side, the simulated house is implemented by the
House
artifact that offers the following operations to the agents:-
prepareSite
for preparing the site, generating the eventsitePrepared
one done -
layFloors
for laying the floors, generating the eventfloorsLayed
once done -
buildWalls
for building the walls, generating the eventwallsBuilt
once done -
buildRoof
for building the roof, generating the eventroofBuilt
once done -
fitWindows
for fitting the windows, generating the eventwindowsFitted
once done -
fitDoors
for fitting the doors, generating the eventdoorsFitted
once done -
installElectricalSystem
for installing the electrical system, generating the eventelectricalSystemInstalled
once done -
installPlumbing
for installing the plumbing, generating the eventplumbingInstalled
once done -
paintExterior
for painting the exterior, generating the eventexteriorPainted
once done -
paintInterior
for painting the interior, generating the eventinteriorPainted
once done
-
2. Agent-Centric Coordination: Reasoning on the External Description of Agents
-
Instead of letting the
company
agents choose to which auctions they will participate, thegiacomo
agent now selects them. -
This selection is based on the ability of these agents to handle the required tasks.
-
For that purpose, each
company
agent share a profile of its skills (which task(s) it can handle) withgiacomo
agent. -
Based on the profile of each company, the
giacomo
agent invites the corresponding agent by sending it an invitation message. This message gives to the agent the name of the auction artifact to use for making its bids.
3. Agent Centric Coordination with the use of trust and reputation
-
Going beyond the selection of agents by their profile, the
giacomo
agent now selects them based on their reputation -
The reputation is built from past experiences, based on the quality with which these agents handled the required tasks, on their respect of the deadlines, etc.
-
As for the previous exercise, the
giacomo
agent invites the corresponding agents by sending them an invitation message for the task they have the skills and a good reputation. What is a good reputation is the preference ofgiacomo
. -
The sent message gives to the
company
agent the name of the auction artifact to use for making its bids.