Resource management algorithms for real-time wireless sensor networks with applications in cyber-physical systems