## 3 The Bike-Share Case
### Evaluation--Formulation of Simulation and ML Models
#### 3.4.3 Stocks and Flows Modelling
We also limit our review to a single-station model to simplify how  
Figure 8: Diagram of the stocks and flows structure, demonstrating how key system elements interact in the simulation model. the formulation of stocks and flows enables the mathematical representation needed for simulations. (Figure 11 in the Appendix A provides the full structure, and the GitHub repository contains the equations for the two-station/cluster model.) The first component is the formation of perception about availability, represented by the variable _Perceived bike availability factor_ (PeBAF). This stock variable is shown in the diagram, which zooms in on the stocks, flows and feedback structure used to simulate the real-time behaviour of the system's return flows. Since the decision-maker anchors their perception on forecasted availability, the real-time simulation connects to this critical information through the _Projected Bike Availability Factor_ (PrBAF). To initialise PrBAF before the actual simulation, we run a model using forecasted demand flows (all done programmatically in a Python test workbench). Additionally, as the provider may update projections multiple times daily, a decision parameter controls the refresh frequency, which determines the look-ahead horizon. The process begins by aligning the initial projected stock with the actual stock at the start of the look-ahead horizon. The projected factors feeding into the real-time model are the ratio of projected stock to the station or cluster's maximum capacity. With these definitions, we present the algebraic equations defining the variables involved in the decision-making process, ultimately shaping the perception of the station or cluster's inventory status. 1. Perceived bike availability factor \((t)\) = Perceived bike availability factor \((t-dt)\) + Update perception \(\times\)\(dt\)
2. Initial Perceived bike availability factor = Projected bike availability factor. 3. Update perception = Adjustment towards actual + Adjustment towards projected. 4. Adjustment towards actual = Adaptive smoothing factor \(\times\) Discrepancy to actual. 5. Adaptive smoothing factor = \(f\) (time, Responsiveness to actual)  
Figure 9: Focused view of a single station’s stocks and flows structure, illustrating how return dynamics are modelled. Discrepancy to actual = Bike availability factor \(-\) Perceived bike availability factor \(7\). Adjustment towards projected = (\(1-\)Adaptive smoothing factor) \(\times\) Discrepancy to projected. \(8\). Discrepancy to projected = Projected bike availability factor \(-\) Perceived bike availability factor. \(9\). Projected bike availability factor = \(g\) (rental and return demands, other factors). In the structural equations, the delay variable _Responsiveness to Actual_ determines how quickly the decision-maker integrates the actual Bike Availability Factor (BAF) into their perception. The _Adaptive Smoothing Factor_ (ASF), a non-linear logistic function \(f\) of the current look-ahead step and responsiveness, weighs the perception update. This update combines the deviations from actual (BAF) and projected availability (PrBAF), with ASF applied to the actual deviation and (\(1-\) ASF) to the projected deviation. The function \(g\) represents the generation of projections based on the machine learning forecast, which utilises historical demands and other features. The second component is the risk perception, which gradually updates based on the _Perception delay_ to reflect the current availability perception; this follows the classic anchor-and-adjust heuristic. In the case of risk, the stock variable retains some memory of prior risk, with the delay variable modelling the inertia. Figures 10 and 11 show the simulation result where the projected stock starts at 20 units (about 31% of the station's maximum capacity). In contrast, the initial stock in the real-time model is set to zero, creating a significant discrepancy between BAF and PrBAF. The graphs display the availability and risk curves for high and low responsiveness levels.