Skip to main content

Utilizing Python for Agent-Based Modeling: The Mesa Framework

  • Conference paper
  • First Online:

Part of the book series: Lecture Notes in Computer Science ((LNISA,volume 12268))

Abstract

Mesa is an agent-based modeling framework written in Python. Originally started in 2013, it was created to be the go-to tool in for researchers wishing to build agent-based models with Python. Within this paper we present Mesa’s design goals, along with its underlying architecture. This includes its core components: 1) the model (Model, Agent, Schedule, and Space), 2) analysis (Data Collector and Batch Runner) and the visualization (Visualization Server and Visualization Browser Page). We then discuss how agent-based models can be created in Mesa. This is followed by a discussion of applications and extensions by other researchers to demonstrate how Mesa design is decoupled and extensible and thus creating the opportunity for a larger decentralized ecosystem of packages that people can share and reuse for their own needs. Finally, the paper concludes with a summary and discussion of future development areas for Mesa.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Notes

  1. 1.

    We chose the name Mesa for three weak reasons: (1) It sounded like Mason, (2) It evoked the mesas around Santa Fe, the location of the Santa Fe Institute and home to much complexity research, and (3) It was a short and memorable name that was available on the Python Package Index (PyPI).

References

  • Apache License, Version 2.0 (2004). https://www.apache.org/licenses/LICENSE-2.0. Accessed 28 Feb 2020

  • Comer, K.W.: Who goes first? An examination of the impact of activation on outcome behavior in agent-based models. Ph.D. dissertation, George Mason University, Fairfax, VA (2014)

    Google Scholar 

  • Crooks, A.T., Malleson, N., Manley, E., Heppenstall, A.J.: Agent-Based Modelling and Geographical Information Systems: A Practical Primer. Sage, London, UK (2019)

    Google Scholar 

  • Delgado, P.A.: design and development of an agent-based social simulation visualization tool for indoor crowd analytics based on the library Three.Js. Ph.D. dissertation, Universidad Politecnica De Madrid, Madrid, Spain (2017)

    Google Scholar 

  • Django: Django (version 1.5) (2013). https://www.djangoproject.com/. Accessed 28 Feb 2020

  • Epstein, J.M., Axtell, R.: Growing Artificial Societies: Social Science from the Bottom Up. MIT Press, Cambridge (1996)

    Book  Google Scholar 

  • Escobar, G.F.: Design and implementation of an agent-based crowd simulation model for evacuation of university buildings using Python. Ph.D. dissertation, Universidad Politecnica De Madrid, Madrid, Spain (2017)

    Google Scholar 

  • Gode, D.K., Sunder, S.: Allocative efficiency of markets with zero-intelligence traders: market as a partial substitute for individual rationality. J. Polit. Econ. 101, 119–137 (1993)

    Article  Google Scholar 

  • Google Scholar. Papers Citing Mesa (2020). bit.ly/GScholarMesa. Accessed 28 Feb 2020

    Google Scholar 

  • Hagberg, A., Swart, P., Chult, D.S.: Exploring Network Structure, Dynamics, and Function using NetworkX, Los Alamos National Lab (No. LA-UR-08-05495; LA-UR-08-5495), Los Alamos, NM (2008)

    Google Scholar 

  • Heinz, T.: Location-based game design pattern exploration through agent-based simulation. In: AGILE 2017 Workshop on Geogames and Geoplay, Wageningen, Netherlands (2017)

    Google Scholar 

  • Luke, S., Cioffi-Revilla, C., Panait, L., Sullivan, K., Balan, G.: MASON: a multi-agent simulation environment. Simulation 81(7), 517–527 (2005)

    Article  Google Scholar 

  • Masad, D., Kazil, J.: Mesa: an agent-based modeling framework. In: Huff, K., Bergstra, J. (eds.) Proceedings of the 14th Python in Science Conference, Austin, TX, pp. 53–60 (2015)

    Google Scholar 

  • McCabe, S.: Communicating sequential agents: an analysis of concurrent agent scheduling. MA thesis, George Mason University, Fairfax, VA (2016)

    Google Scholar 

  • Neves, F., Campos, P., Silva, S.: Innovation and employment: an agent-based approach. J. Artif. Soc. Soc. Simul. 22(1), 8 (2019)

    Article  Google Scholar 

  • North, M.J., et al.: Complex adaptive systems modeling with repast simphony. Complex Adapt. Syst. Model. 1(1) (2013). https://doi.org/10.1186/2194-3206-1-3

  • Patel, A.: Red Blob Games: Hexagonal Grids (2019). https://www.redblobgames.com/grids/hexagons/. Accessed 28 Feb 2020

  • Pike, T.: Integrating computational tools into foreign policy: introducing mesa packages with a coalition algorithm. J. Policy Complex Syst. 4(2) (2018). https://doi.org/10.18278/jpcs.4.2.5

  • Pires, B., Goldstein, J., Molfino, E., Ziemer, K.S.: Knowledge sharing in a dynamic, multi-level organization: exploring cascade and threshold models of diffusion. In: Proceedings of the 2017 International Conference of the Computational Social Science Society of the Americas Santa Fe, NM (2017)

    Google Scholar 

  • Railsback, S.F., Lytinen, S.L., Jackson, S.K.: Agent-based simulation platforms: review and development recommendations. Simulation 82(9), 609–623 (2006)

    Article  Google Scholar 

  • Robinson, D.: Why Is Python Growing So Quickly? (2017). https://stackoverflow.blog/2017/09/14/python-growing-quickly/. Accessed 28 Feb 2020

  • Sullivan, K., Coletti, M., Luke, S.: GeoMason: GeoSpatial Support for MASON, Department of Computer Science, George Mason University, Technical Report Series, Fairfax, VA (2010)

    Google Scholar 

  • Wilensky, U.: NetLogo. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL (1999). http://ccl.northwestern.edu/netlogo

Download references

Acknowledgements

While originally developed by Jackie Kazil and David Masad, Mesa has had over 70 contributors. A special thank you to Corvince, rht, Taylor Mulch, and Tom Pike for their contributions or continuing support to Mesa.

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Jackie Kazil .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2020 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Kazil, J., Masad, D., Crooks, A. (2020). Utilizing Python for Agent-Based Modeling: The Mesa Framework. In: Thomson, R., Bisgin, H., Dancy, C., Hyder, A., Hussain, M. (eds) Social, Cultural, and Behavioral Modeling. SBP-BRiMS 2020. Lecture Notes in Computer Science(), vol 12268. Springer, Cham. https://doi.org/10.1007/978-3-030-61255-9_30

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-61255-9_30

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-61254-2

  • Online ISBN: 978-3-030-61255-9

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics