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
e0727a37
Commit
e0727a37
authored
Mar 02, 2016
by
Matthew Hausknecht
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated python interface to include trajectory recording.
parent
d5665ab8
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
22 additions
and
6 deletions
+22
-6
hfo/hfo.py
hfo/hfo.py
+18
-4
hfo/hfo_c_wrapper.h
hfo/hfo_c_wrapper.h
+3
-2
src/HFO.hpp
src/HFO.hpp
+1
-0
No files found.
hfo/hfo.py
View file @
e0727a37
...
...
@@ -52,7 +52,7 @@ hfo_lib.HFO_new.restype = c_void_p
hfo_lib
.
HFO_del
.
argtypes
=
[
c_void_p
]
hfo_lib
.
HFO_del
.
restype
=
None
hfo_lib
.
connectToServer
.
argtypes
=
[
c_void_p
,
c_int
,
c_char_p
,
c_int
,
c_int
,
c_char_p
,
c_char_p
,
c_bool
]
c_int
,
c_char_p
,
c_char_p
,
c_bool
,
c_char_p
]
hfo_lib
.
connectToServer
.
restype
=
None
hfo_lib
.
getStateSize
.
argtypes
=
[
c_void_p
]
hfo_lib
.
getStateSize
.
restype
=
c_int
...
...
@@ -89,10 +89,24 @@ class HFOEnvironment(object):
server_port
=
6000
,
server_addr
=
'localhost'
,
team_name
=
'base_left'
,
play_goalie
=
False
):
""" Connect to the server """
play_goalie
=
False
,
record_dir
=
''
):
"""
Connect to the server on the specified port. The
following information is provided by the ./bin/HFO
feature_set: High or low level state features
config_dir: Config directory. Typically HFO/bin/teams/base/config/
uniform_number: player's uniform number.
server_port: port to connect to server on
server_addr: address of server
team_name: Name of team to join.
play_goalie: is this player the goalie
record_dir: record agent's states/actions/rewards to this directory
"""
hfo_lib
.
connectToServer
(
self
.
obj
,
feature_set
,
config_dir
,
uniform_number
,
server_port
,
server_addr
,
team_name
,
play_goalie
)
server_port
,
server_addr
,
team_name
,
play_goalie
,
record_dir
)
def
getStateSize
(
self
):
""" Returns the number of state features """
...
...
hfo/hfo_c_wrapper.h
View file @
e0727a37
...
...
@@ -16,10 +16,11 @@ extern "C" {
int
server_port
,
char
*
server_addr
,
char
*
team_name
,
bool
play_goalie
)
{
bool
play_goalie
,
char
*
record_dir
)
{
return
hfo
->
connectToServer
(
feature_set
,
config_dir
,
uniform_number
,
server_port
,
server_addr
,
team_name
,
play_goalie
);
play_goalie
,
record_dir
);
}
int
getStateSize
(
hfo
::
HFOEnvironment
*
hfo
)
{
return
hfo
->
getState
().
size
();
}
void
getState
(
hfo
::
HFOEnvironment
*
hfo
,
float
*
state_data
)
{
...
...
src/HFO.hpp
View file @
e0727a37
...
...
@@ -26,6 +26,7 @@ class HFOEnvironment {
* server_addr: address of server
* team_name: Name of team to join.
* play_goalie: is this player the goalie
* record_dir: record agent's states/actions/rewards to this directory
*/
void
connectToServer
(
feature_set_t
feature_set
=
HIGH_LEVEL_FEATURE_SET
,
std
::
string
config_dir
=
"bin/teams/base/config/formations-dt"
,
...
...
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