Plots showing the outcome of four representative simulations, (i)–(iv), of contained simulations, with a randomly placed vessel distribution and initial bacterial location. (a)–(b) are plots of the spatial distribution of all elements: at the start of the simulation, with the initial bacterial cluster highlighted by the black circle (a) and at the end of the simulation (b). Red circles depict the blood vessels, black circles depict the caseum, blue circles show the fast-growing extracellular bacteria, cyan circles show the slow-growing extracellular bacteria, green dots depict macrophages (with darker green for the infected/chronically infected macrophages) and yellow dots depict the T cells. Plots of bacterial numbers are shown in (d), depicting fast-growing extracellular bacteria (dark blue), slow-growing extracellular bacteria (cyan) and intracellular bacteria (green). Note that individual figures are available in Supplementary material for closer inspection. (For interpretation of the references to colour in this figure legend, the reader is referred to the web version of this article.)