Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
Seminar-HFO
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-HFO
Commits
fd499c06
You need to sign in or sign up before continuing.
Commit
fd499c06
authored
Jul 07, 2017
by
drallensmith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix actionToString (action is not a str variable, what is returned is); streamline act
parent
1f507b72
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
+6
-8
hfo/hfo.py
hfo/hfo.py
+6
-8
No files found.
hfo/hfo.py
View file @
fd499c06
...
...
@@ -116,14 +116,12 @@ class HFOEnvironment(object):
hfo_lib
.
getState
(
self
.
obj
,
as_ctypes
(
state_data
))
return
state_data
def
act
(
self
,
*
args
):
def
act
(
self
,
action_type
,
*
args
):
""" Performs an action in the environment """
assert
len
(
args
)
>
0
,
'Not enough arguments provided to act'
action_type
=
args
[
0
]
n_params
=
hfo_lib
.
numParams
(
action_type
)
assert
n_params
==
len
(
args
)
-
1
,
'Incorrect number of params to act: '
\
'Required
%
d, provided
%
d'
%
(
n_params
,
len
(
args
)
-
1
)
params
=
np
.
asarray
(
args
[
1
:]
,
dtype
=
np
.
float32
)
assert
n_params
==
len
(
args
),
'Incorrect number of params to act: '
\
'Required
%
d, provided
%
d'
%
(
n_params
,
len
(
args
))
params
=
np
.
asarray
(
args
,
dtype
=
np
.
float32
)
hfo_lib
.
act
(
self
.
obj
,
action_type
,
params
.
ctypes
.
data_as
(
POINTER
(
c_float
)))
def
say
(
self
,
message
):
...
...
@@ -144,11 +142,11 @@ class HFOEnvironment(object):
def
actionToString
(
self
,
action
):
""" Returns a string representation of an action """
return
hfo_lib
.
actionToString
(
action
.
decode
(
'utf-8'
)
)
return
hfo_lib
.
actionToString
(
action
)
.
decode
(
'utf-8'
)
def
statusToString
(
self
,
status
):
""" Returns a string representation of a game status """
return
hfo_lib
.
statusToString
(
status
)
return
hfo_lib
.
statusToString
(
status
)
.
decode
(
'utf-8'
)
def
getUnum
(
self
):
""" Return the uniform number of the agent """
...
...
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