Adaptive service function for system reward maximization under elastic traffic model