Modelling wastewater treatment resilience for improved decision making and resource recovery