NetLogo Models Library:
Run El Farol in your browser|
uses NetLogo 5.0.4
requires Java 5 or higher
Note: If you download the NetLogo application, every model in the Models Library (besides the Community Models) is included. If you have trouble running this model in your browser, you may wish to download the application instead.
## WHAT IS IT?
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.
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.
## HOW IT WORKS
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 OVERCROWDING-THRESHOLD. 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. 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.
The number of potential strategies an agent has is given by NUMBER-STRATEGIES, and these potential strategies are distributed randomly to the agents during SETUP, but at any one tick each agent will only utilize one strategy, based on its previous ability to predict the attendance of the bar. The length of the attendance history the agents can use for a prediction or evaluation of a strategy is given by MEMORY-SIZE.
## HOW TO USE IT
To use the model, set the NUMBER-STRATEGIES, OVERCROWDING-THRESHOLD and MEMORY size, press SETUP, and then GO.
The plot shows the average attendance at the bar over time.
## THINGS TO NOTICE
The green part of the world represents the homes of the patrons, while the blue part of the world represents the El Farol Bar. Over time the attendance will increase and decrease but its mean value comes close to the OVERCROWDING-THRESHOLD.
## THINGS TO TRY
Try running the model with different settings for MEMORY-SIZE and NUMBER-STRATEGIES. What happens to the variability in attendance as you decrease NUMBER-STRATEGIES? What happens to the variability in the plot if you decrease MEMORY-SIZE?
## EXTENDING THE MODEL
Currently the weights that determine each strategy are randomly generated. Try altering the weights so that they only reflect a mix of the following agent strategies:
- always predict the same as last week's attendance
- an average of the last several week's attendance
- the same as 2 weeks ago
Can you think of other simple rules one might follow?
At the end of Arthur's original paper, he mentions that though he uses a simple learning technique (the "bag of strategies" method) almost any other kind of machine learning technique would achieve the same results. In fact Fogel et al. implemented a genetic algorithm and got different results. Try implementing another machine learning technique and see what the results are.
## NETLOGO FEATURES
Lists are used to represent strategies and attendance histories.
`n-values` is useful for generating random strategies.
## RELATED MODELS
Arthur's original model has been generalized as the Minority Game which also exists in the Models Library. In addition there is a model called El Farol Network Congestion that uses the El Farol Bar Problem as a model of how to choose the best path in a network. Finally, there is an alternative implementation of this model with more parameters that is part of the NetLogo User Community Models.
## CREDITS AND REFERENCES
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, p406-411.
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, p142-146.
## HOW TO CITE
If you mention this model in a publication, we ask that you include these citations for the model itself and for the NetLogo software:
* Rand, W. and Wilensky, U. (2007). NetLogo El Farol model. http://ccl.northwestern.edu/netlogo/models/ElFarol. Center for Connected Learning and Computer-Based Modeling, Northwestern Institute on Complex Systems, Northwestern University, Evanston, IL.
* Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern Institute on Complex Systems, Northwestern University, Evanston, IL.
## COPYRIGHT AND LICENSE
Copyright 2007 Uri Wilensky.
![CC BY-NC-SA 3.0](http://i.creativecommons.org/l/by-nc-sa/3.0/88x31.png)
This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License. To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/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 firstname.lastname@example.org.