Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
seminar-breakout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shashank Suhas
seminar-breakout
Commits
adb684c0
Commit
adb684c0
authored
Jul 18, 2016
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mapplayerstate
parent
ba4fcf2a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
tensorpack/RL/common.py
tensorpack/RL/common.py
+10
-1
No files found.
tensorpack/RL/common.py
View file @
adb684c0
...
@@ -8,7 +8,8 @@ import numpy as np
...
@@ -8,7 +8,8 @@ import numpy as np
from
collections
import
deque
from
collections
import
deque
from
.envbase
import
ProxyPlayer
from
.envbase
import
ProxyPlayer
__all__
=
[
'PreventStuckPlayer'
,
'LimitLengthPlayer'
,
'AutoRestartPlayer'
]
__all__
=
[
'PreventStuckPlayer'
,
'LimitLengthPlayer'
,
'AutoRestartPlayer'
,
'MapPlayerState'
]
class
PreventStuckPlayer
(
ProxyPlayer
):
class
PreventStuckPlayer
(
ProxyPlayer
):
""" Prevent the player from getting stuck (repeating a no-op)
""" Prevent the player from getting stuck (repeating a no-op)
...
@@ -68,3 +69,11 @@ class AutoRestartPlayer(ProxyPlayer):
...
@@ -68,3 +69,11 @@ class AutoRestartPlayer(ProxyPlayer):
if
isOver
:
if
isOver
:
self
.
player
.
restart_episode
()
self
.
player
.
restart_episode
()
return
r
,
isOver
return
r
,
isOver
class
MapPlayerState
(
ProxyPlayer
):
def
__init__
(
self
,
player
,
func
):
super
(
MapPlayerState
,
self
)
.
__init__
(
player
)
self
.
func
=
func
def
current_state
(
self
):
return
self
.
func
(
self
.
player
.
current_state
())
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment