Simulating Historical Communication Networks in Python

SiempreViernes1 pts0 comments

Simulating Historical Communication Networks in Python | Programming Historian

Donate to Programming Historian today!

Programming Historian

Donate today!

Great Open Access tutorials cost money to produce. Join the growing number of people supporting Programming Historian so we can continue to share knowledge free of charge.

Contents

Overview

Lesson Goals<br>Technical Requirements

Part 1: Introduction to Simulations and Agent-Based Modeling<br>1.1 Why use Historical Simulations for our Case Study?

1.2 What are Simulations?

1.3 What is Agent-Based Modeling?

1.4 Historical Context of Agent-Based Modeling

Part 2: Programming Agent-Based Models with Mesa<br>2.1 Goals

2.2 What About Data?

2.3 Key Concepts of Agent-Based Models<br>Agents

Space (or Environment)

Model

Time

Experimentation

2.4 Overview of Mesa

2.5 Building the Model<br>2.5.1 Setting up the model

2.5.2 Adding Time

2.5.3 Agent Step

2.5.4 Running your First Model

2.5.5 Adding Space

2.5.6 Collecting Data

2.5.7 Visualization and Interactive Features of Mesa

Part 3: Summary, Open Questions and Next Steps<br>3.1 Suggestions for Extending the Model

3.2 Further Steps and Resources

3.3 Final Remarks

Endnotes

Overview

In this lesson, we will provide an introduction to a simulation method called ‘Agent-Based Modeling’ (often abbreviated to ABM), via an Agent-Based Model of a historical letter-sending network, implemented with the Python package mesa.

The historical case that inspired this lesson is the ‘Republic of Letters’, an early modern network of scholars who wrote to each other extensively, thereby fertilizing each other’s thinking. It has already been extensively studied with digital methods12. Using our Agent-Based Model, we want to better understand the social dynamics of this correspondence network and how it was able to shape the scientific thought of the time.

The model we will build together is relatively basic, featuring only simple interactions like sending letters. Those simple interactions will lead to correspondence networks that are structurally similar to those observed in actual, historical datasets on letter sending.

The model we build here will not be sufficiently complex to give genuinely valuable perspectives on this case study on its own, but it will highlight some key properties of ABMs, and various ways to implement them. Crucially, by the end of this lesson, you will be able to extend the model further with more complex functionalities.

In the first part, you will learn what historical simulation methods are all about, their methodological and epistemological quirks, and how to start applying Agent-Based Modeling to your own research.

In the second part, you will follow a step-by-step guide to building your first Agent-Based Model, using the Python package mesa. This will be accompanied by further comments and reflections on the methodology of Agent-Based Modeling.

In the third part, you will explore ways to extend the model and further enhance your expertise in building Agent-Based Models.

Lesson Goals

This lesson intends to:

Teach conceptual basics of simulation methods and ‘Agent-Based Modeling’

Teach fundamentals of the Python package mesa for programming Agent-Based Models

Give you guidance and resources for extending your Agent-Based Modeling knowledge beyond this tutorial

Give an overview of methodological and epistemological caveats, challenges, and considerations when programming your own historical Agent-Based Model

Users of different skill levels and interests will find this lesson useful, for example if:

You are completely unfamiliar with simulation methods and Agent-Based Modeling, and want a thorough introduction

You already have a conceptual understanding of Agent-Based Modeling, and are wondering whether it could be useful for your own research project

You already know that Agent-Based Modeling might be useful for your research, and now want to learn the modeling and technical implementation processes

You are familiar with all of the above and need a starting point for implementing Agent-Based Models with mesa

Technical Requirements

For this lesson, mesa and its dependencies are necessary. Additionally, we will use matplotlib for visualizations and numpy for some calculations. Note that a solid understanding of Python is required for this lesson! If you are unfamiliar with features such as classes, tuples, list comprehension, and nested for-loops, but you do have previous Python experience, you could head over to w3schools to get up to speed. If you would like to have a more gentle and comprehensive introduction, head over to the Programming Historian introduction to Python. You could also follow this lesson using Jupyter Notebooks and read the corresponding introduction to Jupyter Notebooks.

If you want to follow this lesson on your local machine, you need to set up an environment with mesa installed. If you do not know how to do this, we have a simple step-by-step guide, which we...

agent based model modeling lesson historical

Related Articles