# Problem 1(b)(ii): same 4x4 grid but with no goal and no lava, so no terminal states
# compare gamma = 1 with gamma = 0.95
from common import make_mdp, run_vi

for g in [1.0, 0.95]:
    mdp = make_mdp(goal_locs=[], lava_locs=[], gamma=g)
    n_iter, v_start, v_hist = run_vi(mdp)
    print('gamma', g)
    print('  iterations:', n_iter)
    print('  hit the 500 iteration limit:', n_iter == 500)
    for k in [1, 10, 100, n_iter]:
        if k <= n_iter:
            print('  lowest value at iteration', k, ':', round(min(v_hist[k - 1].values()), 2))
