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.
#### Example C++ Agent
```c++
HFOEnvironment hfo;
// Connect to the agent's server on port 6000 and request low-level
// feature set. See manual for more information on feature sets.
hfo.connectToAgentServer(6000, LOW_LEVEL_FEATURE_SET);
// Play 5 episodes
for (int episode=0; episode<5; episode++) {
status_t 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();
// 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: ";
HFOEnvironment hfo;
hfo.connectToAgentServer(6000, LOW_LEVEL_FEATURE_SET);
for (int episode=0; episode<5; episode++) {
status_t status = IN_GAME;
while (status == IN_GAME) {
const std::vector<float>& feature_vec = hfo.getState();
Action a = {DASH, 20.0, 0.0};
status = hfo.act(a);
}
cout << "Episode " << episode << " ended";
}
```
## 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