Modeling and shaping the lifetime of target detection sensor networks