-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmdp.py
More file actions
54 lines (43 loc) · 1.36 KB
/
Copy pathmdp.py
File metadata and controls
54 lines (43 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import abstract
# ABSTRACT CLASS FOR GENERAL MDP'S
class MarkovDecisionProcess:
def getStates(self):
"""
Return a list of all states in the MDP.
Not generally possible for large MDPs.
"""
abstract
def getStartState(self):
"""
Return the start state of the MDP.
"""
abstract
def getPossibleActions(self, state):
"""
Return list of possible actions from 'state'.
"""
abstract
def getTransitionStatesAndProbs(self, state, action):
"""
Returns list of (nextState, prob) pairs
representing the states reachable
from 'state' by taking 'action' along
with their transition probabilities.
Not available in reinforcement learning.
"""
abstract
def getReward(self, state, action, nextState):
"""
Get the reward for the state, action, nextState transition.
Not available in reinforcement learning.
"""
abstract
def isTerminal(self, state):
"""
Returns true if the current state is a terminal state. By convention,
a terminal state has zero future rewards. Sometimes the terminal state(s)
may have no possible actions. It is also common to think of the terminal
state as having a self-loop action 'pass' with zero reward; the formulations
are equivalent.
"""
abstract