Reducing the need for communication in wireless sensor networks using machine learning and planning techniques