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
851d2059
You need to sign in or sign up before continuing.
Commit
851d2059
authored
Jul 07, 2017
by
drallensmith
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
README.md update for Python 3.X; adjustment to high_level_custom_agent.py
parent
fd499c06
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
README.md
README.md
+1
-1
example/high_level_custom_agent.py
example/high_level_custom_agent.py
+5
-2
No files found.
README.md
View file @
851d2059
...
@@ -69,7 +69,7 @@ for (int episode=0; episode<5; episode++) {
...
@@ -69,7 +69,7 @@ for (int episode=0; episode<5; episode++) {
```
python
```
python
hfo
=
hfo
.
HFOEnvironment
()
hfo
=
hfo
.
HFOEnvironment
()
hfo
.
connectServer
(
...
)
hfo
.
connectServer
(
...
)
for
episode
in
xrange
(
5
):
# replace with range(5) for Python 3
.X
for
episode
in
range
(
5
):
# replace with xrange(5) for Python 2
.X
status
=
IN_GAME
status
=
IN_GAME
while
status
==
IN_GAME
:
while
status
==
IN_GAME
:
features
=
hfo
.
getState
()
features
=
hfo
.
getState
()
...
...
example/high_level_custom_agent.py
View file @
851d2059
...
@@ -52,11 +52,14 @@ def get_action(state,hfo_env,num_teammates):
...
@@ -52,11 +52,14 @@ def get_action(state,hfo_env,num_teammates):
curr_goal_angle
=
goal_op_angle
):
curr_goal_angle
=
goal_op_angle
):
hfo_env
.
act
(
PASS
,
teammate_uniform_number
)
hfo_env
.
act
(
PASS
,
teammate_uniform_number
)
return
return
# not sure if below check is needed - doDribble in agent.cpp includes
# (via doPreprocess) doForceKick, which may cover this situation depending
# on what existKickableOpponent returns.
if
can_dribble
(
dist_to_op
=
state
[
9
]):
if
can_dribble
(
dist_to_op
=
state
[
9
]):
hfo_env
.
act
(
DRIBBLE
)
hfo_env
.
act
(
DRIBBLE
)
return
return
# If nothing can be done
pass
# If nothing can be done
, do not do anything
hfo_env
.
act
(
PASS
)
# doesn't this require a target teammate?
hfo_env
.
act
(
NOOP
)
def
main
():
def
main
():
...
...
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