Home Download Help Resources Extensions FAQ NetLogo Publications Contact Us Donate Models: Library Community Modeling Commons User Manuals: Web Printable Chinese Czech Farsi / Persian Japanese Spanish

NetLogo Models Library: 
If you download the NetLogo application, this model is included. You can also Try running it in NetLogo Web 
This model is from Chapter Three of the book "Introduction to AgentBased Modeling: Modeling Natural, Social and Engineered Complex Systems with NetLogo", by Uri Wilensky & William Rand.
This model is in the IABM Textbook folder of the NetLogo Models Library. The model, as well as any updates to the model, can also be found on the textbook website: http://www.introtoabm.com/.
El Farol is a bar in Santa Fe, New Mexico. The bar is popular  especially on Thursday nights when they offer Irish music  but sometimes becomes overcrowded and unpleasant. In fact, if the patrons of the bar think it will be overcrowded they stay home; otherwise they go enjoy themselves at El Farol. This model explores what happens to the overall attendance at the bar on these popular Thursday evenings, as the patrons use different strategies for determining how crowded they think the bar will be. This version extends the El Farol Extension 2 model by adding a histogram of the reward values.
El Farol was originally put forth by Brian Arthur (1994) as an example of how one might model economic systems of boundedly rational agents who use inductive reasoning.
An agent will go to the bar on Thursday night if they think that there will not be more than a certain number of people there  a number given by the OVERCROWDINGTHRESHOLD. To predict the attendance for any given week, each agent has access to a set of prediction strategies and the actual attendance figures of the bar from previous Thursdays. A prediction strategy is represented as a list of weights that determines how the agent believes that each time period of the historical data affects the attendance prediction for the current week. One of these weights (the first one) is a constant term which allows the baseline of the prediction to be modified. This definition of a strategy is based on an implementation of Arthur's model as revised by David Fogel et al. (1999). The agent decides which one of its strategies to use by determining which one would have done the best had they used it in the preceding weeks.
Interestingly, the optimal strategy from a perfectly rational pointofview would be to always go to the bar since you are not punished for going when it is crowded, but in Arthur's model agents are not optimizing attending when not crowded, instead they are optimizing their prediction of the attendance.
The number of potential strategies an agent has is given by NUMBERSTRATEGIES, and these potential strategies are distributed randomly to the agents during SETUP. As the model runs, at any one tick each agent will only utilize one strategy, based on its previous ability to predict the attendance at the bar. In this version of the El Farol model, agents are given strategies and do not change them once they have them, however since they can change their strategies at any time based on performance, the ecology of strategies being used by the whole population changes over time. The length of the attendance history the agents can use for a prediction or evaluation of a strategy is given by MEMORYSIZE. This evaluation of performance is carried out in UPDATESTRATEGIES, which does not change the strategies, but rather updates the performance of each strategy by testing it, and then selecting the strategy that has the best performance given the current data. In order to test each strategy its performance on MEMORYSIZE past days is computed. To make this work, the model actually records twice the MEMORYSIZE historical data so that a strategy can be tested MEMORYSIZE days into the past still using the full MEMORYSIZE data to make its prediction.
The NUMBERSTRATEGIES slider controls how many strategies each agent keeps in its memory. The OVERCROWDINGTHRESHOLD slider controls when the bar is considered overcrowded. The MEMORY slider controls how far back, in the history of attendance, agents remember. To run the model, set the NUMBERSTRATEGIES, OVERCROWDINGTHRESHOLD and MEMORY size, press SETUP, and then GO.
The BAR ATTENDANCE plot shows the average attendance at the bar over time. The REWARD DISTRIBUTION histogram shows the number of turtles with each reward value. The MAX REWARD monitor shows the highest reward for any agent. The MIN REWARD monitor shows the lowest reward for any agent. The AVG REWARD monitor shows the mean reward for all agents.
Does the histogram give you more useful information for understanding the agents' behavior than the monitors did in the second extension?
How do different numbers of strategies, or memorysize affect the distribution of reward?
Lists are used to represent strategies and attendance histories.
nvalues
is useful for generating random strategies.
Arthur's original model has been generalized as the Minority Game and is included in the models library. Wilensky, U. (2004). NetLogo Minority Game model. http://ccl.northwestern.edu/netlogo/models/MinorityGame. Center for Connected Learning and ComputerBased Modeling, Northwestern University, Evanston, IL.
There is a participatory simulation version of the Minority Game model in the models library.
Stouffer, D. & Wilensky, U. (2004). NetLogo Minority Game HubNet model. http://ccl.northwestern.edu/netlogo/models/MinorityGameHubNet. Center for Connected Learning and ComputerBased Modeling, Northwestern University, Evanston, IL.
There is an alternative implementation of this model with more parameters that is part of the NetLogo User Community Models.
This model is adapted from:
Rand, W. and Wilensky, U. (1997). NetLogo El Farol model. http://ccl.northwestern.edu/netlogo/models/ElFarol. Center for Connected Learning and ComputerBased Modeling, Northwestern University, Evanston, IL.
This model is inspired by a paper by W. Brian Arthur. "Inductive Reasoning and Bounded Rationality", W. Brian Arthur, The American Economic Review, 1994, v84n2, p406411.
David Fogel et al. also built a version of this model using a genetic algorithm. "Inductive reasoning and bounded rationality reconsidered", Fogel, D.B.; Chellapilla, K.; Angeline, P.J., IEEE Transactions on Evolutionary Computation, 1999, v3n2, p142146.
This model is part of the textbook, “Introduction to AgentBased Modeling: Modeling Natural, Social and Engineered Complex Systems with NetLogo.”
If you mention this model or the NetLogo software in a publication, we ask that you include the citations below.
For the model itself:
Please cite the NetLogo software as:
Please cite the textbook as:
Copyright 2007 Uri Wilensky.
This work is licensed under the Creative Commons AttributionNonCommercialShareAlike 3.0 License. To view a copy of this license, visit https://creativecommons.org/licenses/byncsa/3.0/ or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
Commercial licenses are also available. To inquire about commercial licenses, please contact Uri Wilensky at uri@northwestern.edu.
(back to the NetLogo Models Library)