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); status_t status = IN_GAME;
// Play 5 episodes while (status == IN_GAME) {
for (int episode=0; episode<5; episode++) { const std::vector<float>& feature_vec = hfo.getState();
status_t status = IN_GAME; Action a = {DASH, 20.0, 0.0};
while (status == IN_GAME) { status = hfo.act(a);
// Get the vector of state features for the current state }
const std::vector<float>& feature_vec = hfo.getState(); cout << "Episode " << episode << " ended";
// Create a dash action }
Action a = {DASH, 20.0, 0.0};
// Perform the dash and recieve the current game status
status = hfo.act(a);
}
// Check what the outcome of the episode was
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