Extending the lifetime of a network of battery-powered mobile devices by remote processing: a markovian decision-based approach