Skip to main content

Using MATSim as a Component in Dynamic Agent-Based Micro-Simulations

  • Conference paper
  • First Online:
Book cover Engineering Multi-Agent Systems (EMAS 2019)

Abstract

This paper discusses use of the widely used transport simulator, MATSim, as one component in a large complex agent based microsimulation where dynamic changes in the environment require the agents to be reactive as well as goal directed. We describe a number of refinements to MATSim that have been made to facilitate its use within our deployed wildfire evacuation applications, as well as some tools that have been developed which complement MATSim. All code is freely available under open source licenses. As applications increasingly require complex microsimulations, with many aspects, it is important to use existing software where possible. However most simulation systems, like MATSim, have been developed as standalone systems. We identify ways that MATSim has needed to be extended or modified in order for it to be used as a component in a larger whole. The paper provides details that will be useful for anyone wanting to use MATSim within their specific application.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 44.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 59.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

Institutional subscriptions

Notes

  1. 1.

    The code for these models is accessible from https://github.com/agentsoz/ees.

  2. 2.

    A plan encompasses activities, trips which contain the (possibly multi-modal) movement between activities, and routes which are the detailed road/path segments to be traversed by a vehicle/person.

  3. 3.

    http://matsim.org/javadoc \(\rightarrow \) matsim main \(\rightarrow \) EditPlans, EditRoutes, EditTrips.

  4. 4.

    The custom AgentInCongestionEvent is triggered on LinkLeaveEvent if \( (t_{k,i} - t^{*}_{k,i})/t^{*}_{k,i} > w \ , \) where k is some traversed link, i is the current link, time \(t_{k,i}\) is the recorded travel time for the route taken from k to i, and \(t^{*}_{k,i}\) is the expected travel time if travelling at freespeed on that route. The constant w is the congestion tolerance threshold. Practically, we set a time period T for congestion evaluation and take the maximum permissible \(t_{k,i}\) such that \(t_{k,i} \le T\). For instance, \(T = 300, w = 0.4\) means that an agent will consider itself to be stuck in congestion if over the last 5 min, the time delay in travelling the route from k to i was greater than 40% of the expected travel time for that route. – The nextLinkBlocked event is generated when the following link has freespeed close to zero as the intent is to prevent the agent from entering a blocked link where it might get stuck forever.

  5. 5.

    https://www.openstreetmap.org/.

  6. 6.

    Software is available at https://github.com/agentsoz/synthetic-population.

  7. 7.

    This software can be accessed at https://github.com/agentsoz/ees-synthetic-population/tree/master/plan-algorithm.

  8. 8.

    The aim is not to build calibrated populations, but instead build representative populations that capture sufficient richness of activities while being relatively easy for domain experts to specify. However this tool is potentially suitable only for relatively small geographical areas in its current state, as with large scale scenarios, a random destination choice with a uniform distribution leads to distances that are too large (in the average half the scenario diameter). Nevertheless it has been useful for the current applications and is an area of ongoing work.

  9. 9.

    An intention is simply the code stack resulting from a top-level instantiated goal.

  10. 10.

    https://github.com/agentsoz/ees/tree/master/scenarios/surf-coast-shire/population-subgroups.

  11. 11.

    Macbook Pro 15,2 with 4 i7 cores (2.7 GHz) and 16 GB RAM.

  12. 12.

    The reported metric is the simulation to real time ratio (s/r), i.e. how much faster than reality the simulation is.

References

  1. Anda, C., Erath, A., Fourie, P.J.: Transport modelling in the age of big data. Int. J. Urban Sci. 21(sup1), 19–42 (2017). https://doi.org/10.1080/12265934.2017.1281150

    Article  Google Scholar 

  2. Balmer, M., Axhausen, K., Nagel, K.: A demand generation framework for large scale micro simulations. Transp. Res. Rec. 1985, 125–134 (2006). https://doi.org/10.3141/1985-14

    Article  Google Scholar 

  3. Balmer, M., Rieser, M., Vogel, A., Axhausen, K., Nagel, K.: Generating day plans using hourly origin-destination matrices. In: Bieger, T., Laesser, C., Maggi, R. (eds.) Jahrbuch 2004/05 Schweizerische Verkehrswirtschaft, pp. 5–36, Schweizer Verkehrswissenschaftliche Gesellschaft (2005)

    Google Scholar 

  4. Batty, M.: Fifty years of urban modeling: macro-statics to micro-dynamics. In: The Dynamics of Complex Urban Systems: An Interdisciplinary Approach, Ascona/Ticino, Switzerland, 4–6 November 2004, p. 27 (2004)

    Google Scholar 

  5. Bazzan, A., Amarante, M.D.B.D., Sommer, T., Benavides, A.J.: ITSUMO: an agent-based simulator for ITS applications. In: Rossetti, R., Liu, H., Tang, S. (eds.) Proceedings of the 4th Workshop on Artificial Transportation Systems and Simulation. IEEE, September 2010

    Google Scholar 

  6. Bouman, P., Lovric, M.: Rotterdam: revenue management in public transportation with smart-card data enabled agent-based simulations. In: Horni, A., Nagel, K., Axhausen, K.W. (eds.) The Multi-Agent Transport Simulation MATSim, chap. 81. Ubiquity, London (2016). https://doi.org/10.5334/baw

  7. Bruch, E., Atwell, J.: Agent-based models in empirical social research. Sociol. Methods Res. 44(2), 186–221 (2015)

    Article  MathSciNet  Google Scholar 

  8. Dahmann, J.S., Kuhl, F., Weatherly, R.: Standards for simulation: as simple as possible but not simpler: the high level architecture for simulation. Simulation 71(6), 378–387 (1998)

    Article  Google Scholar 

  9. Dobler, C., Nagel, K.: Within-day replanning. In: Horni, A., Nagel, K., Axhausen, K.W. (eds.) The Multi-Agent Transport Simulation MATSim, chap. 30, pp. 187–200. Ubiquity Press, London (2016)

    Google Scholar 

  10. Epstein, J., Axtell, R.: Growing Artificial Societies. MIT Press, Cambridge (1996)

    Book  Google Scholar 

  11. Gloor, C., Cavens, D., Nagel, K.: A message-based framework for real-world mobility simulations. In: Klügl, F., Bazzan, A., Ossowski, S. (eds.) Applications of Agent Technology in Traffic and Transportation, Whitestein Series in Software Agent Technologies and Autonomic Computing, pp. 193–209. Birkhäuser, Basel (2005). https://doi.org/10.1007/3-7643-7363-6_13

    Chapter  Google Scholar 

  12. Hamacher, H., Tjandra, S.: Mathematical modelling of evacuation problems: a state of art. Technical report, Fraunhofer ITWM (2001)

    Google Scholar 

  13. Horni, A., Nagel, K., Axhausen, K.W. (eds.): The Multi-Agent Transport Simulation MATSim. Ubiquity, London (2016). https://doi.org/10.5334/baw

    Book  Google Scholar 

  14. Lämmel, G., Klüpfel, H., Nagel, K.: Risk minimizing evacuation strategies under uncertainty. In: Peacock, R., Kuligowski, E., Averill, J. (eds.) Pedestrian and Evacuation Dynamics, pp. 287–296. Springer, Berlin (2011). https://doi.org/10.1007/978-1-4419-9725-8_26

    Chapter  Google Scholar 

  15. Message Passing Interface (MPI) web page. https://www.mpi-forum.org. Accessed 2019

  16. Nicolai, T.W., Nagel, K.: Coupling MATSim and UrbanSim: software design issues. SustainCity Working Paper 6.1, also VSP WP 10–13 (2010). http://www.vsp.tu-berlin.de/publications

  17. Padgham, L., Nagel, K., Singh, D., Chen, Q.: Integrating BDI agents into a MATSim simulation. In: ECAI 2014, pp. 681–686. IOS Press, Prague (2014)

    Google Scholar 

  18. Padgham, L., Singh, D.: Making MATSim agents smarter with the Belief-Desire-Intention framework. In: Horni, A., Nagel, K., Axhausen, K.W. (eds.) The Multi-Agent Transport Simulation MATSim, chap. 31, pp. 201–210. Ubiquity Press, London (2016)

    Google Scholar 

  19. Padgham, L., Winikoff, M.: Developing Intelligent Agent Systems: A practical guide. Wiley Series in Agent Technology. Wiley, Hoboken (2004)

    Book  Google Scholar 

  20. Protocol Buffers Web. https://developers.google.com/protocol-buffers/. Accessed 2015

  21. Rieser, M., Nagel, K., Beuck, U., Balmer, M., Rümenapp, J.: Truly agent-oriented coupling of an activity-based demand generation with a multi-agent traffic simulation. Transp. Res. Rec. 2021, 10–17 (2007). https://doi.org/10.3141/2021-02

    Article  Google Scholar 

  22. Russel, S.J., Norvig, P.: Artificial Intelligence - A Modern Approach, 3rd edn. Pearson Education, Upper Saddle River (2010)

    Google Scholar 

  23. Singh, D., Padgham, L.: OpenSim: a framework for integrating agent-based models and simulation components. In: ECAI 2014, pp. 837–842. IOS Press, Prague (2014)

    Google Scholar 

  24. Singh, D., Padgham, L.: Emergency Evacuation Simulator (EES) - a tool for planning community evacuations in Australia. In: Proceedings of the Twenty-Sixth International Joint Conference on Artificial Intelligence Organization, pp. 5249–5251, Melbourne, August 2017. https://doi.org/10.24963/ijcai.2017/780

  25. Singh, D., Padgham, L., Logan, B.: Integrating BDI agents with agent-based simulation platforms. Auton. Agent. Multi-Agent Syst. 30(6), 1050–1071 (2016). https://doi.org/10.1007/s10458-016-9332-x

    Article  Google Scholar 

  26. Strauch, D., et al.: Linking Transport and Land Use Planning: The Microscopic Dynamic Simulation Model ILUMASS, chap. 20, pp. 295–311. CRC Press, Boca Raton (2005)

    Google Scholar 

  27. W3C: eXtensible Markup Language (XML). World Wide Web Consortium (W3C) (2008). www.w3.org/XML

  28. Waddell, P., Ševčíková, H., Socha, D., Miller, E., Nagel, K.: OPUS: an open platform for urban simulation. In: 9th Conference on Computers in Urban Planning and Urban Management (CUPUM), vol. 428, University College London, UK (2005). http://128.40.111.250/cupum/searchpapers/detail.asp?pID=428

  29. Waddell, P., Borning, A., Noth, M., Freier, N., Becke, M., Ulfarsson, G.: Microsimulation of urban development and location choices: design and implementation of urbansim. Netw. Spat. Econ. 3(1), 43–67 (2003)

    Article  Google Scholar 

  30. Weiss, G. (ed.): Multiagent Systems. A Modern Approach to Distributed Artificial Intelligence. The MIT Press (1999)

    Google Scholar 

  31. Zilske, M., Nagel, K.: A simulation-based approach for constructing all-day travel chains from mobile phone data. Procedia Comput. Sci. 52, 468–475 (2015). https://doi.org/10.1016/j.procs.2015.05.017

    Article  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Dhirendra Singh .

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

Singh, D., Padgham, L., Nagel, K. (2020). Using MATSim as a Component in Dynamic Agent-Based Micro-Simulations. In: Dennis, L., Bordini, R., Lespérance, Y. (eds) Engineering Multi-Agent Systems. EMAS 2019. Lecture Notes in Computer Science(), vol 12058. Springer, Cham. https://doi.org/10.1007/978-3-030-51417-4_5

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-51417-4_5

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-51416-7

  • Online ISBN: 978-3-030-51417-4

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics