Multiagent Netlogo Models

These are NetLogo models that implement multiagent problems or solutions. Click on the title name to see the applet running and get the source code.

If you need us to build a model for you (or just some consulting), don't be shy, just send me an email. I'll be your consultant.

TitleDescriptionLast Modified
Marriage Problem
by Jose M Vidal
There are 64 single men and 64 single women, all heterosexual its is presumed, who want to get married. Each one ranks all possible mates. The problem is how to find the set of marriages so that no two people (one man one woman) that are not married to each other do, in fact, prefer each other over their assigned partners. The solution we implement is the deferred acceptance algorithm from 30 April 2008
Top Trading Cycle Algorithm
by Jose M Vidal
In this problem every node represents an agent with a house that he wants to trade. Every agent has an ordered preference of the other agents' houses he prefers (this list includes the agent's own house). The trick then is to get all agents to trade houses so that they all end up in a house that is at least as good, in their eyes, as the one they currently have.

The Top Trading Cycle Algorithm (TTCA) solves this problem using a very simple greedy method. It was first proposed in:

28 April 2008
Bayes-Ball Algorithm
by Alicia Ruvinsky
An implementation of the Bayes-Ball algorithm for determining irrelevant and requisite information in Bayesian Networks. 19 December 2007
Combinatorial Auction
by Jose M Vidal
Generates and solves a combinatorial auction. The yellow circles represent the items for sale and the green squares represent the bids. Each bid is connected to the items it is over. The square bids with the squares around them are the ones in the revenue-maximizing solution, which we find upon "setup" by running a branch-and-bids algorithm. We implement a branch and bound algorithm on both the branch on items search tree and the branch on bids search tree. The simple branch and bound algorithms implemented here are described in If you want to learn more about combinatorial auctions I recommend 27 October 2007
Sodoku with Distributed Breakout
by William Wiles and Jose M. Vidal
Generates and solves a Sodoku problem using distributed breakout You can edit the puzzle by pushing "edit" and then clicking on a number; it will increase by 1. 25 October 2007
Supply Network Survivability
by Jose M Vidal
This model shows how various supply-chain network topologies fare under attack. The original model was developed to study the military's supply chain vulnerability to terrorist or military attacks, part of the Ultralog project. 22 October 2007
Iterated Equiresitance
by Jose M Vidal
A quick and dirty implemenation of the iterated equiresistance algorithm for exchange networks use in Sociology. The algorithm is described in: The number in the middle of each edge is the amount that edge is worth. The numbers close to the nodes represent the amount that node expects, based on the resistance calculations. The red edges are the ones where an agreement can be reached. 17 October 2007
The Coordination Game
by Jose M Vidal
This is the binary coordination game. Each agent can be either red or blue. At each time step some of the agents change their color simultaneously. The goal is to find out how long it takes, under different conditions, for the population to converge to one color. This problem was presented in 10 October 2007
Pareto Learning
by Jose M Vidal
An implementation of conditional joint action learners (CJAL) in the prisoner's dilemma as described in: These agents reach the Pareto optimal (cooperate,cooperate) solution in repeated play. 06 October 2007
Graph Coloring using ABT kernel
by Ionel Muscalagiu, Jose M. Vidal
This is the implementation of the ABT kernel for the graph coloring problem. We solve the graph coloring problem using the ABT kernel algorithm from 06 October 2007
NQueens ABT kernel
by Muscalagiu Ionel
This is the N-Queens problem solution using ABT kernel as outlined in
  • Christian Bessiere, Arnold Maestre, Pedro Meseguer. The ABT family. In Proceedings of JFNP, 2002
06 October 2007
Evolutionary Game Theory
by Jose M Vidal
A visualization of a population of agents playing repeated games under the standard evolutionary game theory assumptions. We use a simplex to show how these populations evolve over time. Click the forever-go button and then click on the simplex to show how a population at that spot would evolve. 27 September 2007
COIN
by Jose M. Vidal
This model implements the COllective INtelligence framework and attempts to reproduce the results from It implements the wonderful life utility (WLU) clamped down to 0 (no attendance) and 1 (attend every day) and the aristrocatic utility function for the El Farol Bar problem. Since the paper does not mention the exact parameter values used I have been unable to exactly reproduce their results. Namely, this simulation seems to take longer to converge than theirs. Each row in the main output window represents one agent and each of the 7 columns is a day of the week. The patch is set to blue when the agent attends that particular night. Note that the agent often converge if you let the model run over 1000 steps. Optimal global utility is achieved, for num-nights=1, if 3 agents attend every night except one night when all the other agents attend. 25 September 2007
Task Allocation
by William Wiles
Solves a task allocation problem with the coalition formation algorithm from 19 September 2007
Graph Coloring using Adopt
by Jose M Vidal
We solve the graph coloring problem using the Adopt algorithm from

The tree is rooted at the top of the screen. All the lines between nodes represent constraints. The light-colored lines (cyan) are also the parent-child links on the tree. The color of the node is, well, the current color of the node. The numbers on each node represent the LB-threshold-UB:ID.

This is only a beta version!

31 August 2007
Ant System
by Christopher Roach
This model is an implementation of the Ant System algorithm, as described by [1], that is being used to solve the Traveling Salesman Problem. 31 August 2007
Graph Coloring using Distributed Breakout
by Jose M Vidal
An implementation of the distributed breakout algorithm from 30 August 2007
Graph Coloring using Asynchronous Weak-Commitment
by Ionel Muscalagiu, Jose M. Vidal
This is the implementation of the Asynchronous Weak-Commitment Search for the graph coloring problem. We solve the graph coloring problem using the AWCS algorithm from 30 August 2007
Graph Coloring using Asychronous Backtracking with Message Manager
by Hong Jiang, Jose M. Vidal
An implementation of the Asynchronous Backtracking algorithm with Message Manager (MMABT) from 30 August 2007
Graph Coloring using Asychronous Backtracking
by Hong Jiang, Jose M. Vidal
An implementation of the Asynchronous Backtracking algorithm from 30 August 2007
Replicator Dynamics
by Scott Langevin
A visualization of the dynamics of a populations of agents using replicator dynamics. The players are of one of three types, each type playing a pure strategy in a 3x3 game. The user can change the payoffs of the game (but this still needs some work, we also need to add arrow that show direction. You interested?). The results are displayes in a simplex plot where each corner corresponds to one of the strategies. Dark areas correspond to fast movement of the population while lite areas represent slow movement. 23 December 2006
Sodoku with Distributed Breakout
by Scott Langevin
This program utilizes the Distributed Breakout Algorithm (Yokoo and Hirayama) to solve a Sodoku puzzle. The program is based on the Graph Coloring NetLogo program published by Dr. Jose Vidal. 21 November 2006
Value Iteration
by William Wiles
Small demo of the Value Iteration Algorithm 26 October 2006
Reciprocity in Package Delivery
by Jose M Vidal
In the package delivery problem a the agents must deliver a set of packages from a central depot. The destinations lie along one of several spokes emaniting from the central depot. The agents can exchange packages only at the depot. The cost to an agent is proportional to the number of packages carried.
The optimal solution to this problem is to choose one agent to go on each spoke and deliver all the packages scheduled for it. However, this would require completely selfless agents. In this program we study the dynamics that emerege when using different populations of selfish, philantropic, reciprocal, and individual agents behave. These results were first presented in
27 September 2006
Q-Learning
by Seang Chan Ryu
An implementation of the Q-learning algorithm for a simple path-finding domain.
  • Christopher J. C. H. Watkins and Peter Dayan. Q-Learning. Machine Learning, 8(3-4):279--292, 1992.
12 June 2006
Shapebugs
by Matt Baker
This is an implementation of the Shapebugs algorithm from My program begins (via the setup button) by randomly dispersing the agents throughout the display. All agents start in the lost state and assume that they are outside of the desired shape. An agent inside the shape is assumed to have been found. Each agent's movement is as follows:
  • If a neighbor reaches a minimum distance the agent repels that neighbor
  • If an agent finds itself inside of the desired shape, it will follow the above rules as long as such movement does not take it outside of the shape
  • If an agent is inside of the shape, and it determines that its next move will take it outside of the shape, it will instead do one of 2 things: (a) Stay still: 90% probability (b) Move either slightly to the right, left, up, or down: 10% probability
Agent colors:
  • A red agent is an agent outside of the desired shape
  • A blue agent is an agent inside of the desired shape
  • A green agent is an agent that has been displaced
Agents can be added or removed dynamically via the slider. The shake button chooses a random square from the screen and moves all agents within that square in random directions away from their starting positions. Note: I found that using 1,000+ agents seems to work best for modeling the shape.
30 March 2006
Distributed Recommender System
by Jose M. Vidal
A prototype implementation of a distributed recommender system as seen in 22 March 2005
Tileworld
by Jose M Vidal
This is the classic tileworld problem. There are empty holes and tiles. The agents must push the tiles so that they cover the empty holes. Agents can push each other or more than one tile at once. The solution implemented here is the obvious one. AFAIK, there is no consensus on what is the best algorithm for solving this problem. The Tileworld was first introduced in 02 February 2005
Traffic Management
by Benito Mendoza Garcia and Kurt Dresner
This program is a translation into NetLogo of an original Java simulator written by Kurt Dresner and described in The simulator models traffic at intersections and has three different intersection control policies: overpass, traffic light, and reservation system. The program reproduces the results presented in the paper. It has four buttons, labeled Experiment1 through Experiment4, to perform the simulations that produce the results in Figures 2 - 5 of the paper respectively. Results from this experiments are shown in the plots and monitors placed on the right side of the screen. Because experiments take a very long time to run, it will take much time to reproduce the graphs in the figures of the paper. The experiments for figures 6 to 8 can be carried out by changing the parameters accordingly and taking the results from the monitors on the right side of the screen. 15 November 2004
NQueens Asynchronous Weak-Commitment
by Rosa L. Zavala Gutierrez
This is the implementation of the Asynchronous Weak-Commitment Search for the n-queens problem. It also shows the number of messages sent by each agent. It behaves different that the Adopt algorithm in which a few agents end up sending the great majority of the messages. Here, the messages sent are better distributed among the agents. 27 August 2004
Graph Coloring using DisDB
by Ionel Muscalagiu and Jose M Vidal
We solve the graph coloring problem using the DisDB algorithm from

In the constraint graph, constraints are oriented forming a directed acyclic graph, from which an agent hierarchy may be built using heuristic criteria (max-degree, for instance) following the DisAO ordering scheme [Hamadi et al., 1998]. If no heuristic is used, this hierarchy defaults to lexicographic ordering among agents. Considering a generic agent self in the hierarchy, Gama-(self), it the set of agents constrained with self and appearing at higher levels in the hierarchy. Conversely, Gama+(self) is the set of agents constrained with self appearing at lower levels in the hierarchy. This hierarchy induces a partial order among agents, which should be completed to form the total order (using for instance agents identifiers) to ensure completeness.

The DisDB algorithm is executed on each agent, keeping its own agent view and nogood store. The agent view of self is the set of values that it believes to be assigned to agents before self in the total order. The agent view is always consistent with the nogoods in the store. Agents exchange assignments and nogoods. DisDB always accepts new assignments, updating the agent view accordingly. When receiving a nogood, it is accepted if it is consistent with the agent view in Gama - (self) and self , otherwise it is discarded due to obsolescence. An accepted nogood is used to update the agent view of agents not in Gama-(self), and the set of stored nogoods. When all values of an agent are discarded by some nogood, the set of stored nogoods is resolved as in the centralised case, generating a new nogood which is sent to the variable in its right-hand side. This variable plus all variables in the left-hand side of the new nogood that are not in Gama-(self) are unassigned in the agent view, and nogoods are updated accordingly. The process terminates when achieving quiescence, meaning that a solution has been found, or when the empty nogood is generated, meaning that the problem is unsolvable.

11 August 2004
NQueens DisDB (Distributed Dynamic Backtracking)
by Muscalagiu Ionel
This is the N-Queens problem solution using Distributed Dynamic Backtracking-DisDB as outlined in
  • Christian Bessiere, Arnold Maestre, Pedro Meseguer. Distributed Dynamic Backtracking. C. Bessiere, A. Maestre, and P. Meseguer. In M.C. Silaghi, editor, Proceedings of the IJCAI'01 workshop on Distributed Constraint Reasoning, Seattle WA, pages 9-16.
31 July 2004
NQueens Asynchronous Backtracking
by Peter S. Gindhart and Paul Buhler
This is the N-Queens problem solution using asynchronous backtracking as outlined in

The queens are prioritized. Queens with a lower 'who' value are of higher priority. The links this program are directed from a queen to all queens of lower priority (for the ok messages) and from each queen to the queen of next higher priority (for the nogood messages) There is no link request required because these are all the links that are needed. An agents current-view consists of the locations of queens of higher priority. The locations are discovered through 'ok' messages.

Nogoods will be handled as follows. If there is no good position based on the positions of higher priority agents, the queen will forward it's current-view to the next higher queen. Upon recieving a no good an agent will first check to see if the nogood is consistent with it's current agent view.. if not the nogood is ignored. Otherwise the agent moves to the next available good position. If the agent's current view is changed the agent discards his nogood and calculates a new one. Each agent maintains a list of positions flagged as either acceptable or unacceptable. When no acceptable position is available a nogood message is passed up containing the agents current-view.

27 October 2003
Mailmen
by Jose M Vidal
This is the classis MAS mailmen problem where a set of mailmen have to deliver a set of letters. Each letter must be delivered to a different place and mailmen can exchange letters. The goal is to minimize the total distance travelled by the mailmen. It is an instance of a distributed resource allocation problem. The solution provided here is only the most obvious. Better solutions are possible. AFAIK, there is no agreement on what is the best algorithm for solving this problem. This problem was first popularized in
  • Jeffrey S. Rosenschein and Gilad Zlotkin. Rules of Encounter. The MIT Press, Cambridge, MA, 1994.
14 October 2003
Circle
by Jose M Vidal
A very simple application where the turtles move around in a circle. It serves as a fun example of emergent behavior. It also raises interesting questions: What is the most robust way to implement this? What if different people implement different turtles? What if we add some limitations to the environment? etc. 23 January 2003
Path-Finding Using Pheromones
by Jose M Vidal
In this problem a series of drones tries to find a path from the source to the target while staying away from the obstacles. They use pheromones. I tried to implement something similar to 23 January 2003
NQueens Adopt
by Jose M Vidal
This program solves the n-queens problem using the Adopt algorith. The Adopt algorithm appears in 23 January 2003
Congregating in Market Systems
by Jose M Vidal
We implement the congregating algorithm from
  • Chistopher H. Brooks and Edmund H. Durfee. Congregating and market formation. In Proceedings of the 1st International Joint Conference on Autonomous Agents and MultiAgent Systems, pages 96-103, 2002.
23 January 2003

Last modified Thursday, 01 May 2008, 08:40AM. Send comments to Jose M. Vidal.