An optimal control problem formulation for a state dependent resource allocation strategy