Thanks to visit codestin.com
Credit goes to github.com

Skip to content

RL Fixes (Fixing Build) #519

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions mdp.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,18 @@ class MDP:
list of (p, s') pairs. We also keep track of the possible states,
terminal states, and actions for each state. [page 646]"""

def __init__(self, init, actlist, terminals, transitions={}, states=set(), gamma=.9):
def __init__(self, init, actlist, terminals, transitions={}, states=None, gamma=.9):
if not (0 <= gamma < 1):
raise ValueError("An MDP must have 0 <= gamma < 1")

if states:
self.states = states
else:
self.states = set()
self.init = init
self.actlist = actlist
self.terminals = terminals
self.transitions = transitions
self.states = states
self.gamma = gamma
self.reward = {}

Expand Down
Loading