-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTask.py
More file actions
24 lines (20 loc) · 679 Bytes
/
Copy pathTask.py
File metadata and controls
24 lines (20 loc) · 679 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from pybrain.rl.environments.task import Task
class Match3Task(Task):
def getObservation(self):
'''
A filtered mapping to getSample of the underlying environment.
'''
return Task.getObservation(self)
def getReward(self):
'''
Compute and return the current reward
(i.e. corresponding to the last action performed)
'''
return self.env.currentReward()
def performAction(self,action):
#action is ( (p1.x,p1.y), (p2.x,p2.y) )
'''
A filtered mapping towards performAction of
the underlying environment.
'''
Task.performAction(self,action)