Adaptive control of a partially observable stochastic system