Description
Assignment 4
In this assignment you will let agents work together, as introduced in the first chapters of part III of the book. You will implement a number of smart vacuum cleaners that have the shared desire of cleaning all the dirt in the environment. These agents are again based on the BDI framework, i.e., they will generate behaviour based on their beliefs, desires and intentions. However, as each of them will have its own (individual) beliefs and intentions, different agents will execute different actions.
In the scenario for Assignment 4, the world will be populated by n agents (where n is a number between 2 and 7). Moreover, the world will contain n different types of dirt, which will be represented by different colours. The main problem is that each agent can only clean one specific type of dirt. In Assignment 4.1 and 4.2, all agents will have beliefs about ‘who is responsible for which colour’ from the start of the simulation (for instance, ‘agent 1 is responsible for the blue pieces of dirt’, and so on). Instead, in Assignment 4.3 this task distribution is not known in advance, hence the agents need to coordinate this among themselves. Furthermore, the agents will not start with complete information about the world (as was the case in Assignment 3). Instead, they will have to build up their knowledge about the world by exploring it and (in Assignment 4.2 and 4.3) exchanging information about it. Finally, all agents have a limited vision, and thus can only observe local information about the world.
• beliefs:
o about dirty locations o about own colour o about colour of other agents • desires:
o clean all dirty locations o stop and switch off
o no desire
• intentions:
o walk around randomly o observe local environment o send message to another agent
o clean dirt at current location
To make this assignment, you should follow the template that you can find in the files assignment4_1_template.nlogo (for 4.1) and assignment4_2_3_template.nlogo (for 4.2 and 4.3).
IMPORTANT:
• Agents can move in any arbitrary angle.
• The vision radius of each agent must be visualised in the world.
• The actions of the agent should depend directly on its intentions, which means that it will only perform an action if it has a specific intention to do that.
4.1 A Team of Vacuum Cleaners [5 points]
Implement your team of vacuum cleaners in the following way. At time point 0, the agents will have a vision radius according to the value that is set with the slider in the interface. The number of agents and percentage of dirt in the environment are also defined by the interface. The locations of the pieces of dirt should be determined randomly. The monitor in the interface should show the information included in the template for each agent: colour, beliefs, intention, and desire. Because of space limitations, the template only shows this information for the first 3 vacuum cleaners.
Each agent should roughly show the following behaviour:
• If I do not have any beliefs about pieces of dirt with my own colour, then I will move in a random direction until I hit the border of the grid.
• If I have beliefs about pieces of dirt with my own colour, then I will clean the one that is closest to my current location.
• If I arrive at a location, I will observe all cells within my vision radius.
• If I observe a piece of dirt with my own colour, I add it to my belief base (which can be represented as a list of Cartesian coordinates). • I do not communicate with other agents.
All beliefs, desires and intentions should be updated dynamically. Make sure to put actions in the execute-action method, changes in desires in the update-desire method, and so on. Other advices can be found in the NetLogo template.
NetLogo tips:
• The command sort-by could be used to update the order of a given list based on some condition.
• The commands create-link-to and shape can be used to show the radius of the vision of agents.
4.2 Communication [3 points]
Now you will develop a similar team of vacuum cleaners as above, but with a slight (but important) difference: all agents will help each other by communicating relevant information. More specifically, when an agent observes a piece of dirt of another colour than its own, it puts the location of that piece in an outgoing_messages list, in order to send it to the appropriate agent. The messages received will be added to the belief base.
The send-messages method must be called in the go method, after the execute-actions method. In the interface, the lists with outgoing_messages and incoming_messages must be shown during the simulation. Together with the content of the message (i.e., the coordinates of dirt), this part of the interface should also show the colour of the agent that has sent/received the message.
Note that an agent could receive information about the same piece of dirt more than once from different agents, but an agent should only send the information about a specific piece of dirt once.
As you will (hopefully) see, adding communication will result in a team of agents that solves the task more quickly than in the previous assignment.
4.3 Coordination [2 points]
In this assignment the agents will have to coordinate their actions. The reason for this is that, in contrast to the previous assignments, the agents will initially not have any beliefs about ‘who is responsible for which colour’. Instead, they will decide about their own colour on the fly, based on the colours of the pieces of dirt they have observed so far and the specialisation of other agents.
At the start, all vacuum cleaners have a neutral colour (e.g. “White”), which means that they will not collect any dirt. However, they will explore the environment and create beliefs about what they observe. When the number of beliefs about dirty locations of a particular colour reaches a threshold (defined by a slider in the interface, e.g. 5), and no other agent is responsible for that colour yet, they decide to become responsible for that colour, and communicate this immediately to all other agents. From that moment on, their behaviour is the same as in 4.2.
Note that whenever one vacuum cleaner has selected a colour, the others cannot select that colour anymore. Thus, when the one but last agent has chosen its colour, the last agent should choose the remaining colour.
What to hand in?
You have to develop three separate NetLogo models, which correspond to the following assignments:
– Assignment 4.1 [5 points]
– Assignment 4.2 [3 points]
– Assignment 4.3 [2 points]
Please include the three NetLogo models within one .zip-file, and submit this file (as a group) via Blackboard.




Reviews
There are no reviews yet.