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
74c61f55
You need to sign in or sign up before continuing.
Commit
74c61f55
authored
Feb 29, 2016
by
Matthew Hausknecht
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of github.com:larg/HFO
parents
ea53640b
6b328eff
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
8 deletions
+14
-8
README.md
README.md
+13
-7
example/hfo_example_agent.cpp
example/hfo_example_agent.cpp
+1
-1
No files found.
README.md
View file @
74c61f55
...
...
@@ -7,7 +7,6 @@ RoboCup 2D Half Field Offense
## Dependencies
-
Boost-system, filesystem
-
Flex
-
Qt4 [Required for SoccerWindow2 visualizer]: To not build the visualizer, add cmake flag
`-DBUILD_SOCCERWINDOW=False`
## Install
...
...
@@ -21,6 +20,11 @@ make install
From the main HFO directory:
`pip install [--user] .`
## Demos
From the main HFO directory:
```
./example/passing_agents.sh
```
Start a 1v1 game played by Agent2D:
```
./bin/HFO --offense-npcs=1 --defense-npcs=1 --no-sync
...
...
@@ -43,12 +47,13 @@ minimal examples:
#### C++ Agent
```
c++
HFOEnvironment
hfo
;
hfo
.
connectTo
AgentServer
(
6000
,
LOW_LEVEL_FEATURE_SET
);
hfo
.
connectTo
Server
(...
);
for
(
int
episode
=
0
;
episode
<
5
;
episode
++
)
{
status_t
status
=
IN_GAME
;
while
(
status
==
IN_GAME
)
{
const
std
::
vector
<
float
>&
feature_vec
=
hfo
.
getState
();
status
=
hfo
.
act
(
DASH
,
20.0
,
0.0
);
hfo
.
act
(
DASH
,
20.0
,
0.0
);
status
=
hfo
.
step
();
}
cout
<<
"Episode "
<<
episode
<<
" ended"
;
}
...
...
@@ -57,12 +62,13 @@ for (int episode=0; episode<5; episode++) {
#### Python Agent
```
python
hfo
=
hfo
.
HFOEnvironment
()
hfo
.
connect
ToAgentServer
(
6000
,
HFO_Features
.
LOW_LEVEL_FEATURE_SET
)
hfo
.
connect
Server
(
...
)
for
episode
in
xrange
(
5
):
status
=
HFO_Status
.
IN_GAME
while
status
==
HFO_Status
.
IN_GAME
:
status
=
IN_GAME
while
status
==
IN_GAME
:
features
=
hfo
.
getState
()
status
=
hfo
.
act
(
HFO_Actions
.
DASH
,
20.0
,
0.0
)
hfo
.
act
(
DASH
,
20.0
,
0.0
)
status
=
hfo
.
step
()
print
'Episode'
,
episode
,
'ended'
```
...
...
example/hfo_example_agent.cpp
View file @
74c61f55
...
...
@@ -24,7 +24,7 @@ int main() {
// Connect to the server and request low-level feature set. See
// manual for more information on feature sets.
hfo
.
connectToServer
(
features
,
config_dir
,
unum
,
port
,
server_addr
,
team_name
,
goalie
);
team_name
,
goalie
);
// Play 5 episodes
for
(
int
episode
=
0
;
episode
<
5
;
episode
++
)
{
status_t
status
=
IN_GAME
;
...
...
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