Commit a5e31cbf authored by Matthew Hausknecht's avatar Matthew Hausknecht

Updated readme.

parent b387747e
...@@ -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.connectToAgentServer(6000, LOW_LEVEL_FEATURE_SET); hfo.connectToServer(...);
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.connectToAgentServer(6000, HFO_Features.LOW_LEVEL_FEATURE_SET) hfo.connectServer(...)
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'
``` ```
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment