A general Markov decision method I: Model and techniques