Commit b0826462 authored by Matthew Hausknecht's avatar Matthew Hausknecht

Updated Readme.

parent 1d2d833b
...@@ -36,7 +36,9 @@ Or do both in a single command: ...@@ -36,7 +36,9 @@ Or do both in a single command:
``` ```
## Example Agents ## Example Agents
Example C++ and Python agents are provided in the `example` directory.
Example agents are provided in the `example` directory. Below are two
minimal examples:
#### Example C++ Agent #### Example C++ Agent
```c++ ```c++
...@@ -56,12 +58,12 @@ for (int episode=0; episode<5; episode++) { ...@@ -56,12 +58,12 @@ for (int episode=0; episode<5; episode++) {
#### Example Python Agent #### Example Python Agent
```python ```python
hfo = hfo.HFOEnvironment() hfo = hfo.HFOEnvironment()
hfo.connectToAgentServer(6000, HFO_Features.HIGH_LEVEL_FEATURE_SET) hfo.connectToAgentServer(6000, HFO_Features.LOW_LEVEL_FEATURE_SET)
for episode in xrange(5): for episode in xrange(5):
status = HFO_Status.IN_GAME status = HFO_Status.IN_GAME
while status == HFO_Status.IN_GAME: while status == HFO_Status.IN_GAME:
features = hfo.getState() features = hfo.getState()
status = hfo.act((HFO_Actions.DASH, 0, 0)) status = hfo.act((HFO_Actions.DASH, 20.0, 0))
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