Hello,
Need some help please, with printing out the Q-matrix when using MDP and Tabular TD learning.
I have been able to formulate the MDP and the solver and solve the policy. The code is
mdp = TabularMDP(T, R, Discount_factor);
print("\nStep-1: MDP object created")
# use Q-Learning
exppolicy = EpsGreedyPolicy(mdp, 0.02)
q_learning_solver = QLearningSolver(exploration_policy=exppolicy,
n_episodes=1000,
max_episode_length=100,
learning_rate=0.5,
eval_every=10000,
n_eval_traj=20,
verbose=true);
print("\nStep-2: Solver working")
policy = solve(q_learning_solver, mdp)
print("\nStep-3: Policy solved \n")
When I run this in debug mode, I am able to see the value table
How do I print this to console? I tried using
showpolicy(stdout,"text/plain", mdp, policy)
But this shows the following error.
Exception has occurred: MethodError
MethodError: no method matching showpolicy(::Base.TTY, ::String, ::TabularMDP, ::ValuePolicy{TabularMDP, Matrix{Float64}, Int64})
Closest candidates are:
showpolicy(::IO, !Matched::MIME{Symbol(“text/plain”)}, ::MDP, ::Policy; pre, kwargs…)
What would be the correct way to print the q-matrix to console? Thank you