(about-this-book)=

# What is this book about?
Have you ever wondered…

```{raw} html
:file: ../learning_activities_and_widgets/widgets/widget_0_1a_questions_that_motivate_abm.html
```

Studying exactly this, how order that no one designed arises from many simple individuals interacting, is what **agent-based modelling (ABM)** is for. It is the big idea of this book.

```{admonition} In a nutshell
:class: tip
This book teaches you to build computer simulations in **Python** where many simple "agents" interact, and to watch complex, surprising, real-world behaviour **emerge** from the bottom up.
```

## Watch emergence happen

Imagine a busy station concourse at rush hour. Two crowds pour through the same corridor in opposite directions, and no one tells anyone where to walk. Each person follows a single, self-interested rule: head for the far side, and step aside to avoid bumping into whoever is in front. From nothing but that rule, the crowd sorts itself into smooth walking lanes, one flowing one way and the next flowing back. No sign, no planner, and no leader ever draws those lanes.

This is a genuine agent-based model, not a grid of cells switching on and off. Every walker is an autonomous **agent** with its own goal and its own limited view of the handful of people nearby. There is no global recipe for the pattern anywhere in the model. There are only individuals, each reacting to those immediately around them.

Nobody plans the lanes, and each walker senses only the few people closest to them. Press **Run** and watch the crowd organise itself:

```{raw} html
:file: ../learning_activities_and_widgets/widgets/widget_0_1b_pedestrian_lane_demonstration.html
```

<p class="standalone-caption">The two crowds start fully mixed, and each walker only avoids the people ahead. Within seconds they organise into alternating lanes that no one designed, and the lane-order reading climbs as the pattern sharpens. Grab any walker and pull them through the crowd to feel the others give way.</p>

**Nobody arranges those lanes; they emerge.** No single walker can see the whole crowd, no one coordinates the flow, and you cannot find the pattern inside any one person. It lives only in the way the walkers interact. This gap between simple local behaviour and surprising collective order is exactly what agent-based modelling lets you build, measure, and explain. By the end of this book, writing a model like this one will feel routine.

## Who is this book for?

If that gap between what individuals intend and what the group produces intrigues you, this book is written for you: for **students, researchers, and practitioners who want to understand complex systems by simulating them**.

```{raw} html
:file: ../learning_activities_and_widgets/widgets/widget_0_1c_ready_to_start.html
```

## What you will learn

The book takes you from *why we model at all* to *building your own ABMs* with [Mesa](https://mesa.readthedocs.io/), the leading Python framework for agent-based modelling. The sequence is deliberate: first you learn how to frame and judge a model, then how agents, environments, time, and interactions fit together, and only then how to implement and investigate those ideas in code. By the end, you should be able not only to run an ABM, but to explain its assumptions, analyse the behaviour it produces, and judge how far its conclusions can be trusted.

::::{grid} 1 1 2 3
:gutter: 3

:::{grid-item-card} Chapter 1 · Modelling and simulation
:link: ../chapter_1_modelling_simulation/overview
:link-type: doc
What models are, why we build them, the modelling cycle, and what separates a good model from a misleading one.
:::

:::{grid-item-card} Chapter 2 · Fundamentals of ABM
:link: ../chapter_2_fundamentals_abm/overview
:link-type: doc
The core ingredients of every agent-based model (agents, environment, time, interactions, and the model that ties them together), and when ABM beats other modelling approaches.
:::

:::{grid-item-card} Chapter 3 · Your first Mesa model
:link: ../chapter_3_mesa_tutorial/overview
:link-type: doc
A hands-on tutorial where you build a complete ABM, step by step, about households coordinating their washing.
:::

:::{grid-item-card} Chapter 4 · Classic models, rebuilt by you
:link: ../chapter_4_simple_models/overview
:link-type: doc
Simple economies, the Game of Life, traffic flow, a virus on a network, and event scheduling: a first look at how ABM can also drive discrete-event simulation. Each model comes with exercises.
:::

:::{grid-item-card} Chapter 5 · Towards more complex models
:link: ../chapter_5_complex_models/overview
:link-type: doc
Bringing real data into your models, and good practices for serious ABM work.
:::

::::

## How this book works

This is a **do-first** book. The concept chapters (1, 2 and 5) pair short explanations with interactive activities you complete on the page, and the hands-on chapters (3 and 4) give you runnable code and exercises. You run everything in the browser: see {doc}`how_to_use_this_book` for the two-minute tour of the rocket and the Export/Import/Reset buttons that keep your progress safe.

Ready? Then off to {doc}`how_to_use_this_book`.
