Energy-aware dynamic resource allocation in virtual sensor networks