Toward a Theory of Resilience in Systems: A Game-Theoretic Approach