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