refactor manager's running routine. update qlearning agent