Optimizing sensor networks in the energy-density-latency design space