Planning urban energy systems adapting to extreme weather