Approximate Dynamic Programming : a Q-Function Approach