AgentSeal: Agent-based model describing movement of marine central-place foragers

Understanding why animals move as they do when searching for resources is a central question in ecology, and a prerequisite for the development of predictive process-based models for conservation and management. Many species are central-place foragers (CPF). While several models for CPFs have been proposed, they often assume well-defined return rules to the focal point (like breeding). For some CPFs, however, the decisions to return to central sites are governed by multiple interactions between environmental and physiological factors. We present AgentSeal, a behaviourand physiology-based, spatially explicit, agent-based model. We use harbour seals, a marine CPF, as a case study and focus on individuals outside their breeding and moulting seasons to capture general fineand large-scale movements and drivers behind CPF. We model movement decisions based on optimal foraging strategy, cognitive and physiological processes in a realistic landscape, coupled with realistic prey distribution and tuned to a range of behavioural and physiological patterns observed at different scales and levels of organisation (pattern-orientated modelling, POM). The model can reproduce energetic, movement and other behavioural patterns such as net energy balance, atsea and on land site fidelity, daily activity budgets and trip extents. The model reveals the crucial elements needed to model return-trips of CPFs including movement characteristics that vary as a function of local environmental conditions, cognitive mapping of foraging areas as points of attraction in subsequent foraging trips, and physiological requirements defining switches between resting and foraging. We discuss potential applications and extensions of the model, including investigations of fundamental questions in foraging ecology: how spatial distribution and aggregation of resources affect movement of marine CPFs; what are the main drivers behind their at-sea site-fidelity to foraging patches? We also discuss applied objectives such as improving our understanding of population-level consequences of anthropogenic disturbances and ultimately evolving AgentSeal into a practical management tool.


Introduction
Understanding why animals move as they do when searching for resources is a central question in ecology, and a prerequisite for the development of predictive process-based movement models for conservation and management (for example Boult et al., 2018). Such models can increase our understanding of complex decision-making by mobile animals. A predictive process-driven movement model should be able to establish a direct link between individual movement decisions and future distributional, energetic and fitness consequences -and vice versa. If, additionally, such models are spatially explicit, animal movement can be modelled based on a realistic landscape and realistic management scenarios, which also allows for modelling of specific areas and populations of interest. Agent-based models (ABMs) are particularly suitable for this purpose, as they allow us to explicitly represent individual animals and their behavioural decisions. Individual movement can be simulated in a spatially explicit setting and based on fundamental ecological principles such as optimal foraging and learning (Nabe-Nielsen et al., 2018a;Railsback and Grimm, 2012). ABMs can be especially useful whenever variability amongst individuals, local interactions with the environment, or adaptive behaviour are considered essential (DeAngelis and Railsback and Grimm, 2012). Arriving at the appropriate level of complexity for such models is challenging. Under the framework of ABM and pattern-orientated modelling (POM), the mechanisms underlying movement decisions of individuals can be identified by contrasting movement patterns observed in nature with the emergent patterns of models . POM is a strategy for fitting models to multiple patterns, observed at different scales and levels of organisation, and thereby finding the right level of complexity and increasing the chance of capturing the internal organisation of the real system. The goal is to produce structurally realistic models that capture, in a simple yet useful way, the system's generative mechanisms . Models from which multiple empirically observed patterns emerge are likely to include the key processes responsible for animal movement decisions. Examples of such patterns are the spatial distribution of animals, foraging trip extents and duration, changes in time energy budgets, and movement characteristics in relation to food availability in a variety of scenarios .
One type of animal movement behaviour is central-place foraging, where animals repeatedly return to their resting sites or nests after each foraging trip. Modelling movement of central-place foragers with the use of ABMs, when the urge to return to the central point is clearly defined, such as feeding offspring (Massardier-Galatà et al., 2017) or going back to a safe resting place at night (Chudzińska et al., 2016), has been conducted for several species. Movement of central-place foragers when the urge to return to the central point is less understood has not been modelled extensively. Liukkonen et al. (2018) used hypothetical energy thresholds above which animals returned to resting sites to model central-place foraging of Saimaa ringed seals (Phoca hispida saimensis). However, such hypothetical energy thresholds may be insufficient when multiple interacting factors such as the distance to the resting site, predator risk, or physiological state influence when central-place foragers should return and where to.
Here we present AgentSeal, a behaviour and physiology-based, spatially explicit, agent-based movement model. We use harbour seals (Phoca vitulina) -a marine central-place forager, as a case study and focus on adult individuals outside their breeding and moulting seasons to capture general foraging movements. For these two seasons the urges to return to on-land resting sites are clearly defined. However, outside these seasons, the reasons why seals regularly haul-out remain heavily debated (Schneider et al., 1980;Sparling et al., 2007;Terhune, 1985;Thompson et al., 1998a). We use the extensive telemetry data and literature on physiology and behaviour for this species gathered outside the breeding and moulting seasons for POM and calibration of the model. We model movement decisions of this species based on physiological and behavioural urges in a heterogenous landscape, coupled with realistic prey density and compare the resulting simulations to a range of observed behavioural and physiological patterns observed at different scales and levels of organisation.
Harbour seals, like several other pinniped species, require haul-out sites on land (Box 1) for resting, moulting and breeding. They show highly individualistic behaviour and inter-individual variation in terms of movement at sea (Cunningham et al., 2009;Thompson et al., 1998b), foraging behaviour (Bowen et al., 2002), diet (Sharples et al., 2009;Wilson and Hammond, 2016) and daily activity budget (Mikkelsen et al., 2019;Ramasco et al., 2014;Russell et al., 2015). They spend the majority of their time within 50 km of haul-out sites (Cunningham et al., 2009;Thompson et al., 1998b) and are, therefore, frequently exposed to anthropogenic activities, such as offshore renewables, shipping, fishing, and oil and gas activity (Thompson et al., 2013). Further, they are known to be exposed to predation from other marine mammals, and respond to changes in prey availability and quality (De La Vega et al., 2016;Wilson and Hammond, 2019).
The aims of the model presented here are to: i) build a relatively simple movement model of adult harbour seals outside their breeding and moulting season; ii) capture general fine-and large-scale harbour seal movements that are consistent with telemetry observations, energy balance and drivers behind central place foraging (hauling out and atsea movement); iii) capture the high inter-but low intra-individual variability in observed movement and foraging behaviour; iv) identify which aspects of movement and general behaviour of this marine predator are having the strongest effects on the emergent patterns.
We discuss potential applications and extensions of the model, including fundamental questions in foraging ecology, and applied objectives such as improving our understanding of population-level consequences of anthropogenic disturbances.

Materials and methods
In this section we provide details on the life-history and behaviour of the study species and present the general description of the AgentSeal model based on the ODD (Overview, Design concepts, Details) protocol (Grimm et al., 2020(Grimm et al., , 2010. Finally, we describe the model use in a case study: harbour seals from the East coast of Scotland.

Study species
Harbour seals move between haul out sites and at-sea foraging areas (Box 1), showing high site-fidelity towards both of these sites. They usually haul-out in large groups but appear to forage alone.

At-sea foraging movement
Harbour seals spend most of their time close to shore and their foraging trips rarely extend more than 50 km from the haul-out sites, lasting usually <2 days (Cunningham et al., 2009;Thompson et al., 1998bThompson et al., , 1996. Individual seals show high site fidelity to their foraging sites, but seals from the same haul-out sites can forage in different places (Cunningham et al., 2009;Sharples et al., 2012). Experience and memory have been suggested as the main drivers of at-sea site fidelity (Austin et al., 2006(Austin et al., , 2004Carter et al., 2017). While at sea, harbour seals mostly dive to the bottom, irrespective of whether they are travelling or feeding (Mikkelsen et al., 2019;Ramasco et al., 2014). Their 2D at-sea behaviour cannot, therefore, be easily divided into discrete modes such as travelling (moving between foraging patches without consuming prey) and feeding (searching and obtaining food), as observed for some other pinnipeds.

Resting and hauling out behaviour
Seals need to go back to land during the moulting and breeding seasons, but the reasons for hauling out outside these periods is less known. Seals may have to haul-out to sleep (Schneider et al., 1980), to digest (Sparling et al., 2007), for skin maintenance (Feltz and Fay, 1966;Thompson et al., 1998a), and for predator avoidance (Terhune, 1985). But harbour seals are also known to spend long periods resting at the sea surface or at the sea bottom to sleep or digest (Mikkelsen et al., 2019;Ramasco et al., 2014). Digestion is a costly physiological process that is incompatible with the physiological adjustments to diving and may, therefore, be delayed until after periods of active foraging (Sparling et al., 2007). Digestive constraints include stomach capacity and the rate at which food passes through the alimentary tract. Analysis of tracking and diving data from harbour seals reveals that harbour seals frequently rest at two temporal scales: short resting < 1 h and long resting > 1 h (Ramasco et al., 2014). Short resting may be used by seals to pass food from the stomach further down the digestive tract, where food is further digested during longer resting breaks. Resting at sea may be favourable if air temperature is high, as it prevents overheating (Liwanag et al., 2012;Watts, 1992), and it can enable seals to conserve energy by not travelling to a distant haul-out site. Hauling-out time on the other hand, can be used for longer digestion. It can also be used for sleeping, predator avoidance and, additionally, skin cell and general maintenance such as avoidance of ecto-parasites and algal growth (Thompson et al., 1998a). The peripheral tissues of harbour seals cannot metabolise properly at temperatures below 17 • C (Feltz and Fay 1966), so periodic hauling out can assist routine skin growth and maintenance. All these reasons are referred to as 'non-digestive reasons' in the following sections.

Diet, energy budget and habitat preferences
Harbour seals are generalist predators, although individuals may specialise on different prey types. They are bottom and pelagic feeders showing considerable inter-individual variation in prey species and size, foraging sites and seasonal variability (Araújo et al., 2011). Based on examining scat and stomach samples, sandeels, flat fish and gadoids have been found to be the dominant groups of fish prey in the North Sea, but the relative proportion of these groups vary seasonally and regionally (Sharples et al., 2009;Wilson and Hammond, 2016). Adult harbour seals consume on average 3.8 -4.8 kg of fish per day (Härkönen and Heide-Jørgensen, 1991;Kastelein et al., 2005;Sharples et al., 2009;Wilson and Hammond, 2016), which has to support a daily energy expenditure of 14.3 -21.43 MJ/day (Härkönen and Heide-Jørgensen, 1991;Kastelein et al., 2005;Markussen et al., 1990;Renouf and Noseworthy, 1991;Rosen and Renouf, 1998;Sparling, 2003).
Harbour seals tend to forage in inshore waters <50 m deep, on a variety of sediment types. The key driver of harbour seals' distribution at larger spatial scales is, however, distance to haul-out site as they need to return to land between foraging trips (Aarts et al., 2008;Grecian et al., 2018).

Description of agentsealthe odd (Overview, design concepts, details) protocol
We present a model, termed AgentSeal, to simulate movements and energetics of harbour seals (termed mseals, Box 1) in a realistic landscape. Processes in the model such as mseals' decisions take place in discrete, 15 min time intervals. In the following section we present a summary description of the model following the ODD protocol. The full documentation of the model including justification of the used parameter values and assumptions is provided in the supplementary information (SI) in the TRACE (TRAnsparent and Comprehensive model Evaluation) document, which also includes the full ODD . Throughout the text, we use phrases as defined in Box 1.

Purpose and patterns
We aim to build a relatively simple movement model of adult harbour seals which captures general fine-and large-scale harbour seal movements and reproduces their central place-foraging and general behaviour, outside the breeding and moulting seasons. The model is based on optimal foraging theory, assuming that seals adjust their behaviour, like movement, based on their physiological state and knowledge of prey availability.
In order to evaluate whether our model results in realistic behaviour of mseals, we adopted the pattern-orientated modelling approach (POM) Wiegand et al., 2003). The chosen patterns can be grouped into four categories: energetics: energy intake and expenditure, body reserves; movement and other behavioural patterns: spatial distribution of mseals, visual comparison of tracks, overlap of kernel densities, characteristics of foraging trips (Box 1) (duration and extent) and fine-scale movement (step length and turning angle), and proportion of different activities performed by mseal (resting, foraging) and at-sea foraging site fidelity. We also evaluate one environmental pattern: food depletion. Although there is no observed data on this pattern, we still use it to understand whether food depletion may be an important driver of seal movement and behaviour. We include a broad range of patterns to evaluate the performance of AgentSeal. We use POM in two phases of the modelling cycle. During model development it is used for parameterisation to check which combinations of parameter values resulted in realistic mseal behaviour, and in model evaluation to establish whether the model outputs are sufficiently realistic for its intended application (Rykiel, 1996). Table 1 summarises which patterns are used within the modelling cycle and gives a brief description of the data sources used for the Case study described below. All patterns used in the parameterisation phase of the modelling can be compared quantitively (see SI for details).

Entities, state variables, and scales
The model includes the following entities: mseals, landscape patches (Box 1) and on-land resting sites (haul-out sites). The entities can be characterised by static (fixed over the entire model duration) or dynamic (updated at each time step) state variables, or a combination of these, as listed in Table 2.
The spatial extent of the landscape can be based on any area defined by the user (see Case study for an example). One time step in the model represents 15 min and each landscape patch in the model represents 1 × 1 km.
The model is programmed in NetLogo 6.02 (Wilensky, 1999) and the code is provided in the SI (section 9).

Process overview and scheduling
Processes: The processes are structured into six procedures as described below. They describe the central-place foraging and haul-out movements of adult harbour seals outside the breeding and moulting seasons. The graphical description of the model flow is shown in Fig. 2.
Scheduling: The order of the procedures is the same for each time step but, as the model assumes no hierarchies amongst mseals, the order in which individuals execute a given procedure is randomised at each time step. For each mseal, each state variable is immediately assigned a new value as soon as that value is calculated by a procedure (Table 2).
a) FORAGEthis procedure represents mseals' search for and capture of food. Fine-scale movements of mseals are simulated using a mixture of correlated random walk (CRW) and spatial memory behaviour resulting in biased movements (correction of mseals' heading 'pulling' them back on track towards the target) towards profitable memorised target places (biased correlated random walk or BCRW). The movement vector of each mseal ( v → res )is the sum of the vectors v → CRW and v → bias and has two components: turning angle (TA, degrees [− 180, 180]) and length (speed, m/s) ( σ] is a change in turning angle drawn from a normal distribution with σ related to habitat suitability index (HSI, see Case study for an example), a measure of food availability (Bartumeus et al., 2005) (see section 1.7.1.2 in SI). As a result, mseals have more tortuous movement in areas of higher food availability (high HSI) and transit through areas of low food availability (low HSI).
TA v → bias is the difference between mseal's current heading and heading towards the target (see GO TO HAUL-OUT and HAUL-OUT procedures to see how the target is chosen). The importance of the bias component of TA v → res is proportional to i) HSI: the better the habitat quality the weaker the bias towards the target; and ii) distance to the Table 1 Summary of different patterns used for model parameterisation and evaluation. Detailed descriptions about the use of the patterns and more information on the data are given in SI (Tables 1-2 and sections 2    Schematic illustration of biased correlated random walk. Each vector has two components: turning angle (TA) and length (L, also referred to as step length or speed). The TA of final movement vector v → res is the resultant of these angles of v → CRW (related to previous turning angle and habitat suitability index of the patch) and v → bias (bias towards target foraging patch or a haul-out site also related to the habitat suitability index of the patch). The length of v → res is drawn from the observed (based of GPS tracking of seals) speed distribution and is independent of the length in the previous time step. target: the closer to the target the stronger the bias. See section 1.7.1 in the SI for details of how these values are calculated.
The length of the resulting vector ( v → res , speed of mseals) is drawn from a gamma distribution, as observed based on the GPS tracking of seals (see Eq. 4 in the SI), and is independent of the speed of the previous time step.
Mseals remember visited patches (M patch , Eq. 2) and the amount of food captured in these patches (EI patch , Eq. 2). They also update their memory of haul-out sites passed within a certain, calibrated distance during foraging (2 km in the Case study). Haul-out memory does not decay with time. Memory of patches (M patch ), on the other hand, decays with time. During foraging, mseals consume fish, the amount of which is related to fish availability in the visited patches, N [fish/m 2 ] and a search rate [sr, m 2 /time step]. The actual number of fish consumed is then drawn from a Poisson distribution Poisson(λ=N * sr) and parameterised to resemble reality. Number of caught fish is then corrected for the level of mseals fat reserves based on the assumption that overweight seals have reduced diving capacity due to their increased buoyancy. This amount is then translated into consumed energy [kJ] based on observed diet composition of harbour seals. The consumed fish are then subtracted from fish available in the patch (food depletion). There is currently no food replenishment in the model. If mseals are too close to land they turn to avoid it, except when they are about to haulout.
If the daily amount of consumed fish is not enough to cover daily energy expenditure for a certain number of days in a row (7 days in the Case study), mseals switch to exploratory, large-scale foraging movement. There are two types of such movement and there is equal probability of a mseal choosing either after the 'hungry' period: i) the CRW is not biased towards any defined patch, and ii) the CRW is biased towards one of the patches from the initial memory list (see Initialisation in the Case study for details). In either of these cases, the previous memory of mseals is cleared, except the initial knowledge of the area. a) TIME TO REST? -mseals evaluate if it is time to rest based on the amount of food consumed (NEED TO DIGEST?). If it is, they further decide whether to rest at sea or go to a haul-out site to digest this food based on the distance to various haul-out sites (CLOSE TO THE NEXT HAUL-OUT SITE?). b) TIME TO HAUL-OUT? -even if mseals do not have to rest due to digestive constraints, they evaluate if it is time to haul-out if they haven't done so for a given time period (NEED TO HAUL-OUT FOR NON-DIGESTIVE REASONS?). Mseals are, however, less likely to haul-out if in bad condition (low blubber reserves, GENERAL CON-DITION GOOD?). This is based on the assumption that the need to continue foraging in order to regain condition has a priority over other drivers to haul out. c) REST AT SEA -mseals rest at sea to digest food and the duration of this rest is influenced by mseals' digestion capability (stomach capacity or amount of consumed fish in relation to total body weight). d) GO TO HAUL-OUT SITE -this procedure is very similar to FORAGEthe difference is the target towards which the movement is biased: in FORAGE it is a patch, in GO TO HAUL-OUT SITE it is a haul-out site.
The target haul-out site is chosen based on current distances to the different haul-out-sites and the memory values of these sites related to the frequency of previous visits: previously visited sites have highest memory value followed by sites which mseals previously passed by but were not visited, and then remaining sites. If mseals are not close to shore, they move according to correlated random walk biased towards the target haul-out site. If mseals are close to shore, they follow the shortest path along the shore to get to the haul-out site. e) HAUL-OUTmseals haul-out for a duration depending on haul-out reason (digestive or non-digestive). This haul-out site where this event actually takes place is assigned a higher memory value, which does not decay with time. At the end of the haul-out event, mseals evaluate which food patch to head to next. Each food patch stored in the memory has an attractiveness value calculated (Eq. (2.)), based on mseals' previous energy intake obtained in the patch (EI patch [kJ]), memory value since last visit of this patch (M patch, is unitless and can be assigned values from 0 to 0.99, with 0.99 meaning that the patch has just been visited). We used the same approach as (Mitchell and Powell, 2004;Van Moorter et al., 2009) and implemented by  and let this attractiveness decrease linearly with Euclidean distance to it (D target [m]).
Patches which were visited recently, which resulted in high prey capture and which are close to the haul-out site are assigned the highest attraction value.
At the end of each time step mseals calculate their net energy intake (NEI) as the difference between energy obtained from fish and expenditure. If NEI > 0, mseals convert the excess energy into storage (blubber), otherwise they lose weight (see section 1.7.6 in the SI). If the mass of blubber of mseals drops beneath 5% of their total body weight, they die (Beltran et al., 2017). Mseals may only change their body mass; growth (change in body length) is not included in the model.

Design concepts
Here we present a reduced version of this section of the ODD. A full version of this section, containing all required subsections, is presented in section 1.4 of the SI.

Basic principles.
Mseals optimise their foraging movements by increasing the time spent in good quality habitat and minimising distance travelled by relating their movements towards good patches. They memorise visited habitat patches and are more likely to return to profitable ones. This memory decays with time. Digestive constraints and non-digestive reasons are the primary drivers behind resting and haulout behaviour.

2.2.4.2.
Emergence. The movement patterns emerge from mseals' different movement characteristics (turning angle and speed) in relation to habitat quality, from their ability to memorise and return to good quality patches, their need to haul-out and their choice of haul-out sites. Energetic patterns emerge from a balance between energy needed for body maintenance (energy expenditure) and fish consumption (energy intake) and define changes in body mass and mass of reserves (blubber). Behavioural patterns (proportion of time spent resting at sea, foraging and hauling out) emerge from mseals' physiological constraints (for example digestive constraints), distance to the next haul-out site and energy intake, defining whether to take a digestive break or not. Site fidelity emerges from the fact that seals are more likely to revisit a patch which resulted in efficient energy intake when visited previously and is close to a frequently visited haul-out site. Finally, environmental patterns (food depletion) result from the consumption of fish within the study site.

Objectives and learning.
The objective of mseals is to maximise their net energy intake, while taking their digestive constraints and need to periodically haul out into account. Mseals increase their chance of finding fish by spending more time in good quality areas and returning to these if previous visits resulted in high food intake, while they will transit through areas of low quality. As marine environments are dynamic and heterogenous, it is unlikely that animals can correctly learn and memorise the quality of all visited foraging patches over a long period of time and we therefore let memory decay logistically with time (Van Moorter et al., 2009). On the other hand, seals can remember and return to haul-out sites even after several years (Cordes and Thompson, 2015;Mackey et al., 2008), and mseals therefore remember all the visited haul-out sites. This knowledge does not decay with time.

Observation.
At the end of each time step, all dynamic state variables are saved for each seal (Table 2.). At the end of each simulation the final HSI of the patches are saved, as well as the cumulative number of mseals visiting each water patch.

Simulation: case study and model analysis 2.3.1. Case study: description and initialisation
We test the model for one case study: the east coast of Scotland (Fig. 3) using patterns presented in Table 1 (see sections 1.1. and 2 in the SI for more details).
The model was initialised by creating 350 mseals: the harbour seal population status for East Scotland (SCOS, 2017) for 2010-2016, distributed over 16 haul-out sites as per the survey data. We ran simulations for three months starting from midnight 1 October, representing the post-moulting season, in 15 min time intervals. There is limited migration and exchange between subpopulations of harbour seals around Scotland Olsen et al., 2017;Sharples et al., 2012). The model environment was thus considered a closed system and no new mseals appeared in the model over the model duration. Values of mseals state variables (Table 2): sex, length, and initial total mass and mass of body reserves, basic metabolic rate (a function of total body mass) and stomach capacity (a function of total body mass) were assigned during initialisation (section 1.5 in the SI). Sex influenced initial body length and the relationship between body length and total body mass. Within the model no other processes differed between sexes. As the Case study is based on movement of adult seals, we assume that mseals are not naïve seals at the beginning of the simulations, but instead possess some knowledge about food distribution within the study site. Mseals' initial list of memorised patches contains, therefore, the location of 90% of patches with highest HSI for each 25 × 25 km square (see Fig. 2 in the SI). However, the list of memorised haul-out sites contained all the haul-out sites within the study area. All sites received a low value of memory level, except the site on which mseal was currently hauling-out. This site's memory value is set to the maximum possible value. Mseal's energy expenditure, energy intake and mass of consumed fish was set to zero at initialisation. A list of all parameters and their values used to calculate state variables of case study entities is given in SI ( Table 2 in SI). The letters a-f refer to the description of these procedures in Process overview and scheduling section. Mseals FORAGE at sea by adjusting their turning angle to the current habitat suitability index and therefore spend more time in habitat of better quality. They also memorise good foraging patches and are more likely to return to these patches later on. At certain conditions mseals rest either to digest food or for other nondigestive reasons. They then decide whether to REST AT SEA or GO TO HAUL-OUT SITE. Grey-coloured flow chart shows the more detailed decision process of mseals whether to rest or not, and if so where.
The model landscape comprised 174 × 185 patches (32,190 km 2 total) and each patch was categorised as either land or water. Each water patch was assigned HSI value, a proxy for habitat quality (Fig. 3). HSI was based on a species distribution model (SDM) quantifying the relationship between observed locations of harbour seals in Scotland and a range of environmental covariates (depth, sea-surface temperature, sediment type and distance to haul-out sites; Grecian et al. (2018)). Distance to haul-out sites was the most important predictor of seal distribution. To construct the suitability map, we used all the covariates from the SDM except distance to haul-out sites, as we wanted the relationship between this distance and mseals' distribution to be an emergent property of the model rather than letting it be enforced by the underlying habitat map. For simplicity, the results from the SDM were normalised to get HSI values between 0 and 1. Each HSI value was then assigned an initial density of fish (N, [fish/m 2 ]). We estimated this density for the best patches (patches with HSI=1) based on scientific survey catches and catchability estimates (Moriarty and Greenstreet, 2017;Walker et al., 2017, see as well section 1.5.1 in SI for details) and then for all the other patches calculated it as scaled value: N = N HSI=1 * HSI patch . The value used in AgentSeal in the case study was N HSI=1 = 4 fish/m 2 (see section 2.3 in SI for details).

Model analysis in case study: parameter estimation and pom
There were 36 parameters in the Case study for AgentSeal. Twenty-six of these were assigned values based on literature and data (see Table 2b in SI). The remaining ten parameters were obtained through indirect parameter estimation (Kramer-Schadt et al., 2007). Due to the large number of unknown parameters in the model and the possibility of interactions between them, model parameter estimation was divided into two stages. We first estimated parameters defining fine-scale movement: BCRW. The remaining parameter values were estimated in the second stage using fixed values of the parameters assigned in the first stage. These were parameters related to energy intake, memory and haul-out behaviour (see section 2 in the SI).
We used the patterns described in the previous section (patterns 1 and 2, Table 1) to filter parameter combinations which best represent the observed patterns (inverse modelling: Kramer-Schadt et al., 2007).
For detailed description of the filtering as well as methods used to compare modelled and observed patterns see the SI (sections 2 and 5). The final simulation was repeated a further 49 times resulting in a total of 50 simulations.

Model analysis in the case study: robustness analysis (RA) and sensitivity analysis (SA)
The aim of the robustness analysis is to assess the extent to which different decisions about the model processes influence model dynamics and how robust the model is to major changes in its structure (Grimm and Berger, 2016;Levins, 1966;Railsback and Grimm, 2012;Thiele and Grimm, 2015). We therefore performed structural and analytical modifications of the model to understand which processes are essential to the model and when and why our model did not work, i.e. when the model mechanisms that explained a certain phenomenon broke down. For the RA we chose to focus on processes which are poorly understood and difficult to measure in nature.
We ran the following model modifications: I 'No food depletion': the number of available fish per patch did not change over the model duration. The aim of this step was to test whether depletion was an important driver of seal movement and behaviour. This modification is run over three months. II 'No memory': at-sea movement of mseals was only driven by CRW. Mseals did not memorise the visited patches and did not move towards a specific target patch after leaving haul-out sites. Instead they moved according to CRW. The movements were still biased toward the haul-out sites once mseals switched to this behaviour. This modification aimed at understanding whether the POM patterns (especially movement patterns) of the model emerge as a result of returning to previously visited food patches. This modification is run over one month. III 'Modified HSI'. In order to investigate the influence of the specific HSI map used here on model output, we also ran the model using two artificial habitat suitability maps: drawing a distribution of 'hot spots' at random, and a map with uniformly distributed prey. These two modifications are run over three months.
The aim of the sensitivity analysis (SA) was to explore the influence of parameter values on the outputs of the model (emergent patterns). We ran the SA for parameters whose values were uncertain, see section 6.1 in the SI for details (Marino et al., 2008).

Case studyparameter selection
The frequency distribution of turning angles (TA) of mseals was similar to observed (Fig. 4A, pattern 1.1 in Table 1). The observed and modelled correlations in turning angles between two consecutive steps are significant and comparable (Pearson's correlation: R 2 =0.07, p<0.01, t 1,276,040 =39.2 for turning angles of the observed values and R 2 =0.09, p = 0.01, t 1,34,137 =2.5 for the modelled values). (Fig. 4B, pattern 1.2 Table 1).
Mean daily energy expenditure of mseals (pattern 2.2, Table 1) is 16.2 +/-4.1 MJ/day (sd around 50 means = 0.14 MJ/day based on 50 simulations). This fits within the range of observed values which are between 14.3 and 21.43 MJ/day. The model reproduced no changes in blubber proportion (pattern 2.3, Table 1 ) over three-month simulation as observed (Fig. 5B). The majority of individuals did not exceed a blubber content of 40% of total body mass. During 50 simulations none of the mseals reduced its blubber content to <5% of total body mass and, consequently, none died (Fig. 5C).
Each mseal visits very few haul-out sites, consistent with the observations (Fig. 6A, pattern 2.5, Table 1). Mseals perform longer (in time) foraging trips (pattern 2.6, Table 1) than observed, and the model underestimates the number of very short foraging trips ( Fig. 6B and see also parameterisation in section 2.3 in the SI). The model produces a similar frequency distribution of extent of foraging trips (pattern 2.7, Table 1) to that observed (Fig. 6C). Also the frequency distribution of mseals' at-sea positions with distance from the departure haul-out site (pattern 2.8, Table 1) is similar to observed, although the model overestimates the number of positions very close to the haul-out sites and underestimates the number of positions 15 -25 km from the sites (Fig. 6D). The model produces the same core areas of mseals' geographical distribution (pattern 2.9, Table 1..) as observed (Fig. 6D). The size of the kernels depends not only on number of observed seals but also the tagging place. We only have information on harbour seals tagged off St Andrews and Aberdeen and have very few tracks from the Firth of Forth (for place names see Fig. 3). Mseals did not use the area east of St Andrews (the 'Wee Bankie', Fig. 3) as intensely as the observed seals. There were, however, only two observed seals frequently visiting the bank in the original data set, which is also reflected in the absence of any hot spots with high HSI in this area. We, therefore, consider the model to be able to capture the overall spatial distribution of seals.
There is very little variation between model results of the 50 replicates for all POM patterns (Fig. 5, Fig. 6).

Case studymodel validation: emerging patterns
Food depletion by mseals (pattern 3.1, Table 1) was calculated as percentage decreases in HSI of each patch from the beginning to the end of model simulation. Below we present the mean results of 50 simulations. Maximum decrease of HSI value due to depletion was 17.4%. The highest depletion occurred along the coast, close to the most popular haul-outs ( Fig. 5D and Fig. 7). Outside these areas, food depletion was

negligible.
We plotted foraging trips of five randomly chosen harbour seals for which we have telemetry data during the study period (see details in section 2.3 of the SI) (pattern 3.2 in Table 1). We then visually compared it to five randomly chosen mseals from one simulation, which visited the same haul-out sites as the tracked seals. The observed tracks show high inter-individual variation, which was reproduced by AgentSeal. Some mseals went further offshore, some were more stationary and some repeatedly followed the coast, as also observed (Fig. 8). Two of the observed seals were repeatedly visiting the Wee Bankiean offshore submarine sand/gravel bank to the east of St Andrews (Fig. 3, Fig. 8). None of the mseals from the randomly chosen individuals visited this offshore area.
To compare at-sea site fidelity of mseals and observed seals (pattern 3.3, Table 1), we quantified the extent to which the consecutive foraging trips of each of the randomly chosen seals, as above (mseals and observed), overlapped. To do it we divided the study are into 5 × 5 and 25 × 25 km squares (see Fig. 3 in the SI) and calculated how many of these squares overlapped between the consecutive trips of each seal. The model was able to reproduce a general observed site fidelity trend with most mseals having large overlap between consecutive trips (Fig. 9). There was however large variation between individual mseals, as well as between observed seals.

Sensitivity (SA) and robustness (RA) analysis
A descriptive summary of these two analyses is presented below. Details and graphical description (figures) are provided in the SI (section 6).
The SA indicated that results were robust to realistic variation in parameter values. The largest changes were driven by parameters related to digestive physiology of mseals: stomach capacity and the length of short digestive breaks (Figures 54 and 55 in the SI).
Removing food depletion from three-month simulations had no effect on the model results (section 6.2.2 in SI).
Removing memory resulted in mseals going further offshore than observed but the daily fish consumption and changes in proportion of blubber remained comparable to the results of the final model (section 6.2.2 in the SI). Applying the random habitat suitability map revealed that even if potential patches with high prey abundance may be present further offshore, mseals still stayed relatively close to shore. These landscape changes caused the mseals to consume more fish than real seals and resulted in an increase in time spent on digestion (resting), and higher food depletion than in the main model. Simulations with random HSI resulted in a better match between modelled and observed frequency distribution of trip duration than the final model but still underestimating the number of very short trips (section 6.2.2 in SI). Mseals moving over uniformly distributed habitat consumed similar amount of fish as observed and as in the final model simulation.

Discussion
The primary purpose of modelling is to improve our understanding, in this case, of an ecological system (Grimm and Berger, 2016). This improved understanding can serve nature management and conservation, especially when it can be used to answer 'what-if' scenarios. AgentSeal is an ABM which captures the main characteristics of movement, behaviour and physiology of a marine central-place forager. It also identifies gaps in our understanding and can be used to set priorities for further research.
We have demonstrated that AgentSeal can reproduce a range of patterns observed at population and individual levels such as energetic patterns: daily energy expenditure, food consumption and change in proportion of stored blubber; movement and other behavioural patterns: fine-scale movement characteristics, number of visited haul-out sites, trip extent and distribution; and daily activity budgets. The model is able to realistically simulate high inter-individual variability, such as site fidelity towards haul-out and foraging sites. Thus, it generally succeeds in reproducing central-place foraging of harbour seals as an emergent property of the model. Movement of central-place foragers when the urge to return to the   Frequency distribution of the number of squares (5 × 5 and 25 × 25 km) which overlapped between consecutive foraging trips for five random observed (grey) and five random modelled (mseals, red) seals whose tracks are shown in Fig. 8. The error bars show variation between simulations.
central point is clearly defined, such as feeding the offspring or going back to den/nest/colony, has been relatively well understood. What drives animals to return to the central point outside these periods is still under debate. AgentSeal is, to our knowledge, the first ABM which models movement of marine central-place foragers outside the breeding and moulting season which incorporates physiological, behavioural and cognitive processes to drive this central-place movement. The model identifies mechanisms that are the main drivers behind this centralplace foraging movement: physiological (such as the need to rest due to digestive or non-digestive constraints), memory-based movement, and distribution and abundance of prey. In our simulation experiment 29% of hauling-out events are triggered by the need to digest, whereas the remaining events are most likely related to other, possibly physiological, reasons such as skin maintenance or fatigue. Digestion may, on the other hand, be the primary mechanism defining resting at sea as compared with hauling-out on land, as the model can reproduce the observed proportion of time seals spend resting at sea. The mechanism behind resting triggered by digestive constraints has mainly been studied on captive animals (for example Sparling et al., 2007). Understanding the mechanisms behind resting of wild seals and where this takes place (on land, at the sea surface, or at the sea bottom: Mitani et al., 2010, Ramasco et al., 2014, Mikkelsen et al., 2019 should be an important direction of future study, which could be addressed by means of high resolution accelerometery devices coupled with GPS. While a lot of studies are dedicated to understanding how individuals forage optimally, these seemingly important decisions to stay out at sea or return to land are still poorly understood. Without understanding these mechanisms, the assessment of how on-land and near-shore at-sea disturbance affects seals may be biased. AgentSeal can be used as a tool to quantify this bias, given our improved understanding of the mechanism behind resting. As shown by the robustness analysis, removing memory-driven patch choice from the model results in mseals travelling further away from the shore and haul-out sites than the observed seals and, as expected, they no longer show at-sea site fidelity. Introducing unbiased correlated random walk results in mseals moving further away from their starting point (for example Börger et al., 2008) compared with observed harbour seals. However, the addition of memory-driven movement results in realistic site fidelity (Abrahms et al., 2019;Nabe-Nielsen et al., 2013).
Estimation of the distribution and abundance of fish at fine spatial scales is a challenging task due to the dynamic nature of marine resources, and the logistics related to data collection in coastal areas where harbour seals often forage. Various environmental proxies have been used instead to represent habitat suitability for marine top predators (Grecian et al., 2018;Jones et al., 2013). In AgentSeal we couple these proxies with realistic fish abundance. Other studies have used hypothetical or arbitrary numbers (e.g. Liukkonen et al., 2018) and/or artificially created landscapes (Massardier-Galatà et al., 2017). Measuring the actual caloric value and/or fish abundance of different habitats instead of using proxies is the next challenge (but see Aarts et al., 2019;Ransijn et al., 2019). The results of AgentSeal indicate that seals can still show similar, realistic behaviour in different, artificially created habitats (see robustness analysis), suggesting that the application of AgentSeal to new regions where HSI maps would be different in detail, will be successful. But at the same time, the comparison of the results of simulations of three different habitat types (final, randomly generated and uniform) show that the structure of habitat influences behaviour of seals.
Exploring alternative optimal foraging strategies based on giving-up times (see discussion by McNair, 1982;Nonacs, 2001) as exemplified by Nabe-Nielsen et al.'s (2018a) harbour porpoise model and foraging in relation to prey clustering (Mitchell and Powell, 2004;Weimerskirch, 2007) are two strong foci for the future use of AgentSeal. The results of the main model and their modification in RA indicate that if the food is concentrated in a few places, as in the Case study, there are individuals which benefit from foraging in such areas. Individuals, which do not find such areas are of poorer condition. In the uniform habitat, all individuals perform similarly. AgentSeal can, therefore, be used as a tool to study how food distribution may affect seal behaviour. Plausible scenarios may include intensive localised versus more evenly distributed fishing effort, design of marine protected areas in respect to food availability and the exclusion of seals from areas of variable food availability due to anthropogenic disturbances.
The model underestimates the number of short (less than a day) foraging trips. Such trips may be related to resting very close to haul-out sites. The availability of haul-out sites in the study area and all-around Scotland are strongly related to tides and seals may rest close to the shore whilst the haul-out site is submerged. The effect of tide height on haul-out site availability is not yet included in AgentSeal. Another reason why short trips are underestimated may be lack of a standard definition of a foraging trip. Some studies consider a foraging trip as the time from the moment a seal leaves the haul-out site to when it returns to land (Bjørge et al., 1995). Some studies, including this study, add a time buffer around hauling out to include resting close to haul-out sites as part of the haul-out event. However this buffer differs, which makes comparisons difficult (Cunningham et al., 2009;Sharples et al., 2012;Thompson et al., 1998b). Plotting trip duration against their extent suggests that there is a large range of trip durations which take place very close to shore (see Figure 35 in SI). Understanding the role of this near-shore movement of seals, whether they are mainly resting (Mikkelsen et al., 2019), or foraging (Bjørge et al., 1995) is key to understanding how human disturbance near haul-out sites may affect seal behaviour and, ultimately, fitness. The model is currently only able to reproduce higher numbers of very short trips (however still lower than observed) if the number of fishes caught in the areas close to shore is much higher than observed fish consumption, and this results in a large increase in blubber stores (see Figure 61 in SI). Standardising the definition of hauling-out and resting very close to shore will assist the POM process.
A good tool for estimating cumulative and simultaneous effect of anthropogenic stressors must be built on solid understanding of animals' physiology, movement and behaviour at various stages of their annual cycles. DEPONS, an ABM for simulating the effect of various stressors on movement and physiology of a small cetacean (harbour porpoise), is a good example of such a tool (Nabe-Nielsen et al., 2018a, 2018b. Cetaceans, which are not central-place foragers, have very different drivers defining their movement than animals which have to go back to land.
In contrast, AgentSeal is the first step in building such a tool for marine central-place foragers. ABMs allow us to explicitly represent individual animals and their behavioural decisions. The incorporation of the relationship between these decisions and seals' physiology and energetics, as well as the spatially explicit design and high temporal resolution of AgentSeal makes it a good candidate to become a reliable management and conservation tool. AgentSeal could be further developed, for example, to simulate short term effects of offshore disturbance on movement of seals and physiological consequences of this disturbance. Currently, AgentSeal only includes adult individuals which convert all their surplus energy budget into body reserves. The next step of AgentSeal could be incorporation of an all year-round dynamic energy budget (DEB as presented in Sibly et al., 2013) in the model, which would include growth, moulting and reproduction. The DEB framework can explicitly model how the relative use of energy for these various purposes can differ under different circumstances, such as different disturbance scenarios. In this way AgentSeal could be used not only to study short-term consequences of human disturbance on movement of seals but also the effect on body condition and reproductive success. We already have some insight into how individual stressors, such as offshore renewables (Thompson et al., 2013), increased predation, reduced prey availability and quality (De La Vega et al., 2016;Wilson and Hammond, 2019), and interactions with vessels (Jones et al., 2017;Mikkelsen et al., 2019) affect the movement and behaviour of harbour seals. This information can be used in POM in the above-mentioned extensions of AgentSeal. The model can also be linked to existing tools which can estimate long-term population level consequences of disturbance such as interim Population Consequence of Disturbance (iPCoD: . Presently, iPCoD is not spatially explicit and the number of individuals affected by a given disturbance is based on impact assessment predictions. AgentSeal could be used as a tool to estimate the number of affected animals and the short-term individual energetic and behavioural consequences of these disturbances. These estimates can then be passed to iPCoD to serve as an input to study long term population level consequences of disturbance.
To summarise, AgentSeal can already, at this stage, be used to study several basic aspects of ecology of marine central-place foragers and explore further several ecological questions in realistic scenarios. This includes questions such as: how spatial distribution, aggregation and abundance of resources, including stressors related to changes in resources like overfishing affects movement, behaviour and physiology of these foragers; what are the main drivers behind their off-and on-shore resting behaviour and how important is digestion in this process; what are the main drivers behind their at-sea site-fidelity to foraging patches. The model can also be applied to other regions and other populations of harbour seals. This way the model can be applied as a tool to prioritise further data collection and analysis.

Authors' contribution
MC, JNN, SS, GA, SB, PT, IG, BM Conceptualization, Methodology. SS, BM, PT, IG, GA, SB and Investigationfield data collection. MC developed the model -Conceptualization, Methodology with large help from JNN. MC, GA, SB analysed the field data -Conceptualization, Methodology. MC leading Writing-Reviewing and Editing, with contributions from all the remaining co-authors

Declaration of Competing Interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.