Abstract
Informal settlements face acute challenges in meeting basic needs for water, energy, and food (WEF) due to resource scarcity, infrastructure limitations, and high population pressures. This study develops an integrated WEF facility model and applies Reinforcement Learning (RL) to optimize both production and allocation of resources across a representative settlement in South Africa. The RL framework was implemented by linking an AnyLogic system dynamics (SD) and Agent Based Modelling (ABM) simulation with a Python-based learning agent using Alpyne and Pypline libraries, enabling adaptive decision-making under dynamic demand conditions.
The performance of the RL agent was benchmarked against AnyLogic’s built-in Genetic Algorithm (GA) optimizer using identical facility and storage capacities to ensure fair comparison. Evaluation was based on three key performance indicators: availability improvement, nexus efficiency, and fairness of allocation. Results showed that while the RL agent underperformed in availability improvement, it achieved higher nexus efficiency (85% vs. 78%) and significantly better fairness of allocation (60–65% vs. 43–51%) compared to the baseline round robin allocation method. These findings highlight the RL agent’s ability to balance trade-offs and prioritize equitable resource distribution, even in resource-constrained environments.
The study contributes methodologically by demonstrating a proof-of-concept integration of system dynamics and agent-based simulation with reinforcement learning for WEF nexus modeling. Practically, it offers a decision-support framework that advances sustainability and fairness in resource management for informal settlements. Future work should incorporate empirical calibration, climate and demand uncertainties, and socio-economic dimensions to further enhance applicability and resilience.