Commit a5dbe25c authored by Matthew Hausknecht's avatar Matthew Hausknecht

Updated Readme.

parent b00c5c18
...@@ -40,23 +40,17 @@ Example C++ and Python agents are provided in the `example` directory. ...@@ -40,23 +40,17 @@ Example C++ and Python agents are provided in the `example` directory.
#### Example C++ Agent #### Example C++ Agent
```c++ ```c++
HFOEnvironment hfo; HFOEnvironment hfo;
// Connect to the agent's server on port 6000 and request low-level hfo.connectToAgentServer(6000, LOW_LEVEL_FEATURE_SET);
// feature set. See manual for more information on feature sets. for (int episode=0; episode<5; episode++) {
hfo.connectToAgentServer(6000, LOW_LEVEL_FEATURE_SET);
// Play 5 episodes
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) {
// Get the vector of state features for the current state
const std::vector<float>& feature_vec = hfo.getState(); const std::vector<float>& feature_vec = hfo.getState();
// Create a dash action
Action a = {DASH, 20.0, 0.0}; Action a = {DASH, 20.0, 0.0};
// Perform the dash and recieve the current game status
status = hfo.act(a); status = hfo.act(a);
} }
// Check what the outcome of the episode was cout << "Episode " << episode << " ended";
cout << "Episode " << episode << " ended with status: "; }
``` ```
## Documentation ## Documentation
......
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