Commit 7cd8aea9 authored by Matthew Hausknecht's avatar Matthew Hausknecht

More informative communication example.

parent 74c61f55
...@@ -41,7 +41,7 @@ int main(int argc, char** argv) { ...@@ -41,7 +41,7 @@ int main(int argc, char** argv) {
// Get any incoming communication // Get any incoming communication
std::string msg = hfo.hear(); std::string msg = hfo.hear();
if (!msg.empty()) { if (!msg.empty()) {
cout << "Agent-" << unum << " HEARD: " << msg.c_str() << endl; cout << "Agent-" << unum << " heard: " << msg.c_str() << endl;
if (msg == "Pass") { if (msg == "Pass") {
agent_on_ball = unum; agent_on_ball = unum;
} }
...@@ -58,6 +58,7 @@ int main(int argc, char** argv) { ...@@ -58,6 +58,7 @@ int main(int argc, char** argv) {
float teammate_y_pos = -target_y; float teammate_y_pos = -target_y;
hfo.act(KICK_TO, teammate_x_pos, teammate_y_pos, 2.0); hfo.act(KICK_TO, teammate_x_pos, teammate_y_pos, 2.0);
hfo.say("Pass"); hfo.say("Pass");
cout << "Agent-" << unum << " said: Pass" << endl;
agent_on_ball = teammate_unum; agent_on_ball = teammate_unum;
} else { } else {
float dist_to_ball = feature_vec[3]; float dist_to_ball = feature_vec[3];
......
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