Agent-based models (ABM) are gaining traction as one of the most powerful modelling tools within the social sciences. They are particularly suited to simulating complex systems. Despite many methodological advances within ABM, one of the major drawbacks is their inability to incorporate real-time data to make accurate short-term predictions. This paper presents an approach that allows ABMs to be dynamically optimised. Through a combination of parameter calibration and data assimilation (DA), the accuracy of model-based predictions using ABM in real time is increased. We use the exemplar of a bus route system to explore these methods. The bus route ABMs developed in this research are examples of ABMs that can be dynamically optimised by a combination of parameter calibration and DA. The proposed model and framework can also be used in an passenger information system, or in an Intelligent Transport Systems to provide forecasts of bus locations and arrival times.A PREPRINT -AUGUST 23, 2019 varies over the route and with at off-peak to peak periods. There are methods to incorporate streaming data into models, such as data assimilation (DA) routines [26,45]. Broadly, DA refers to a suite of techniques that allow observational data to be incorporated into models [45] to provide an optimal estimate of the evolving state of the system. Performing DA increases the probability of having an accurate representation of the current state of the system, thereby reducing the uncertainty of future predictions. This is a technique that has been widely applied in fields such as meteorology, hydrology and oceanography [21].There are, however, two methodological challenges that must be overcome to apply DA in ABM. First, DA methods are often intrinsic to their underlying models which are typically systems of partial differential equations with functions linearised mathematically. Hence DA methods typically rely on linearising the underlying model [16]. One of the most appealing aspects of agent-based models is that they are inherently non-linear, so it is not clear whether the assumptions of traditional DA methods will hold. Second, it is still unknown how much uncertainty DA can effectively deal with when implemented within ABM. Assimilation of real-time data into ABMs has only been attempted a few times and these examples are limited by their simplicity [28,46,47]. This paper is part of a wider programme of work 2 that is focused on developing DA methods to be readily used in ABM. This paper focuses on one particular model that aims to make predictions of bus locations in real time. Bus route operation has been chosen due to its inherent uncertainties -for example a model will need to account for uncertain factors affecting how buses travel on the roads [22] -but also for its tractability -there are many fewer interactions than present in, say, a model of a crowd. We also focus on one particular DA algorithm -the Particle Filter (PF). This method is chosen due to its ability to incorporate data into non-linear models such as ABM...