cs383f2015-lab3
El Farol Bar multi-agent simulations in Repast Simphony.
- For plots and data analysis, check out our IPython notebook
- For documentation of implemented strategies, check out the JavaDoc for our agent classes.
Implementation
We have added three additional agent types:
AgentRan
, which makes a random prediction between the maximum and minimum attendance levels.AgentAverage
, which makes a prediction based on the average of all the remembered attendence levels.AgentMarkov
, which uses a Markov chain predictive model to predict the next attendance.
These new agent types were implemented by extracting an interface Agent
from the public methods in the provided Agent
class (renamed to AgentWeighted
). New agent classes were written to extend this interface, and the ElFarolContextBuilder
class was modified to create agents of the correct type depending on the parameters passed to the model. Additional parameters were added to the Repast model for controlling the distribution of agents, the maximum run time, and other characteristics.
For documentation on the functionality of each agent type, please check out the JavaDoc for their respective Java classes.
We had intended to use Repast's batch mode for running all of the required parameters configurations in the laboratory handout, but this was determined to be impossible due to memory leak bug in Repast. Therefore, each parameters configuration was run by hand, instead.
Analysis & Results
Analysis of the various strategies is contained in this IPython notebook.
Additionally, the graphs generated by Repast Simphony are also available (as PNG files) in the results/repast-plots
directory, and the raw data output by the model is avaiable as comma-separated values files in the results/
directory.
Learning Take-aways
We learned more about Markov chains while implementing the Markov chain prediction strategy. A Markov chain is a memoryless predicitve model which uses only the current state to predict the next state.
We also observed that increasing the number of agents in the model can have siginficant impacts on the model's outcomes. With more agents inside the model, one can see patterns begin to appear within the attendance graphs, as seen in our analysis notebook.
We learned that some strategies are better at handling the threshold differences than others. The regression model is able to even itself out at the threshhold higher than average, but when the threshold is lower, it alternates more widely between attendance levels. Additional information on this behaviour is available in our analysis notebook.