{"action":"created","issue":{"url":"https://api.github.com/repos/sawcordwell/pymdptoolbox/issues/13","labels_url":"https://api.github.com/repos/sawcordwell/pymdptoolbox/issues/13/labels{/name}","comments_url":"https://api.github.com/repos/sawcordwell/pymdptoolbox/issues/13/comments","events_url":"https://api.github.com/repos/sawcordwell/pymdptoolbox/issues/13/events","html_url":"https://github.com/sawcordwell/pymdptoolbox/issues/13","id":67139389,"number":13,"title":"max_iteration parameters is not respected in the ValueIteration Algorithm","user":{"login":"sshegheva","id":6343408,"avatar_url":"https://avatars.githubusercontent.com/u/6343408?v=3","gravatar_id":"","url":"https://api.github.com/users/sshegheva","html_url":"https://github.com/sshegheva","followers_url":"https://api.github.com/users/sshegheva/followers","following_url":"https://api.github.com/users/sshegheva/following{/other_user}","gists_url":"https://api.github.com/users/sshegheva/gists{/gist_id}","starred_url":"https://api.github.com/users/sshegheva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sshegheva/subscriptions","organizations_url":"https://api.github.com/users/sshegheva/orgs","repos_url":"https://api.github.com/users/sshegheva/repos","events_url":"https://api.github.com/users/sshegheva/events{/privacy}","received_events_url":"https://api.github.com/users/sshegheva/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-04-08T14:11:26Z","updated_at":"2015-04-13T14:38:30Z","closed_at":null,"body":"Using the forest example from the quickstart guide and modifying the max_iter does not seem to work.\r\n\r\nIt looks like it always defaults to 39 and stops.\r\n```\r\nimport mdptoolbox.example\r\nP, R = mdptoolbox.example.forest()\r\nvi = mdptoolbox.mdp.ValueIteration(P, R, 0.9, max_iter=100)\r\nvi.run()\r\nvi.policy\r\nprint vi.V\r\nprint vi.max_iter\r\n\r\n(5.051970000000001, 8.291970000000001, 12.291970000000001)\r\n39\r\n```\r\n\r\nI am experimenting with number of iterations to see how the algorithm is performing and it would be very beneficial to collect values at each iteration\r\n\r\nUpdate:\r\n\r\nSetting MDP to verbose shows that only 4 iterations were executed. So what does 39 means here?\r\n\r\n```\r\n\r\n  Iteration\t\tV-variation\r\n    1\t\t  4.0\r\n    2\t\t  2.43\r\n    3\t\t  0.81\r\n    4\t\t  0.0\r\nIterating stopped, epsilon-optimal policy found.\r\n(5.051970000000001, 8.291970000000001, 12.291970000000001)\r\n39\r\n```"},"comment":{"url":"https://api.github.com/repos/sawcordwell/pymdptoolbox/issues/comments/92384569","html_url":"https://github.com/sawcordwell/pymdptoolbox/issues/13#issuecomment-92384569","issue_url":"https://api.github.com/repos/sawcordwell/pymdptoolbox/issues/13","id":92384569,"user":{"login":"sshegheva","id":6343408,"avatar_url":"https://avatars.githubusercontent.com/u/6343408?v=3","gravatar_id":"","url":"https://api.github.com/users/sshegheva","html_url":"https://github.com/sshegheva","followers_url":"https://api.github.com/users/sshegheva/followers","following_url":"https://api.github.com/users/sshegheva/following{/other_user}","gists_url":"https://api.github.com/users/sshegheva/gists{/gist_id}","starred_url":"https://api.github.com/users/sshegheva/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sshegheva/subscriptions","organizations_url":"https://api.github.com/users/sshegheva/orgs","repos_url":"https://api.github.com/users/sshegheva/repos","events_url":"https://api.github.com/users/sshegheva/events{/privacy}","received_events_url":"https://api.github.com/users/sshegheva/received_events","type":"User","site_admin":false},"created_at":"2015-04-13T14:38:30Z","updated_at":"2015-04-13T14:38:30Z","body":"Thanks for the explanation. It is very useful. \r\n\r\nThe reason I wanted to specify the max_iterations is that I can observe the convergence of each algorithm and not all of them have epsilon.\r\n\r\nWhat worked for me is setting the max_iter after the object has been initialized, like\r\n\r\n```\r\nvi = mdptoolbox.mdp.ValueIteration(P, R, 0.96)\r\nvi.max_iter = 10\r\n```\r\n\r\nIn this case it wont go beyond those 10 iterations. \r\n\r\nGreat job, I liked playing with the forest example\r\n"}}