Commit 9fbbf409 authored by sanmit's avatar sanmit

Minor touchups

parent d061c331
......@@ -140,7 +140,7 @@ def parseArgs():
help='Server provides full-state information to agents.')
p.add_argument('--seed', dest='seed', type=int, default=-1,
help='Seed the server\'s RNG. Default: time.')
p.add_argument('--messageSize', dest='messageSize', type=int, default=1000,
p.add_argument('--message-size', dest='messageSize', type=int, default=1000,
help='Message size limit for communication')
args = p.parse_args()
if args.offenseAgents not in xrange(0, 11):
......
......@@ -4,10 +4,7 @@
import sys
# First Start the server: $> bin/start.py
if __name__ == '__main__':
port = 6000
if len(sys.argv) > 1:
port = int(sys.argv[1])
......@@ -31,8 +28,6 @@ if __name__ == '__main__':
# Take an action and get the current game status
hfo.act(HFO_Actions.DASH, 20.0, 0)
hfo.step()
print 'Episode', episode, 'ended with',
# Check what the outcome of the episode was
if status == HFO_Status.GOAL:
......
......@@ -9,7 +9,6 @@ using namespace hfo;
// This agent demonstrates the use of the MOVE_TO action to visit the
// corners of the play field. Before running this program, first Start
// HFO server: $./bin/HFO --offense-agents 1
int main(int argc, char** argv) {
int port = 6000;
if (argc > 1) {
......@@ -31,15 +30,12 @@ int main(int argc, char** argv) {
}
std::cout << "target (x,y) = " << target_x << ", " << target_y << std::endl;
while (status == IN_GAME) {
// Get the vector of state features for the current state
const vector<float>& feature_vec = hfo.getState();
// Perform the action
hfo.act(MOVE_TO, target_x, target_y);
// Advance the environment and get the game status
status = hfo.step();
std::cout << "Status: " << status << " (IN_GAME = " << IN_GAME << ")\n";
}
}
hfo.act(QUIT);
......
......@@ -207,9 +207,6 @@ void HFOEnvironment::connectToAgentServer(int server_port,
}
hear_msg.assign(&(hearMsgBuffer[0]), hearMsgBuffer.size());
}
}
void HFOEnvironment::handshakeAgentServer(feature_set_t feature_set) {
......@@ -363,7 +360,6 @@ status_t HFOEnvironment::step() {
}
hear_msg.assign(&(hearMsgBuffer[0]), hearMsgBuffer.size());
}
return game_status;
}
......
......@@ -125,7 +125,6 @@ Agent::Agent()
lastTeammateMessageTime(-1),
server_port(6008),
client_connected(false),
num_teammates(-1),
num_opponents(-1),
playing_offense(false)
......@@ -486,8 +485,6 @@ void Agent::actionImpl() {
exit(1);
}
std::cout << "[AGENT.CPP] Say message length " << sayMsgLength << std::endl;
// Receive message
std::vector<char> sayMsgBuffer;
sayMsgBuffer.resize(sayMsgLength);
......@@ -500,7 +497,6 @@ void Agent::actionImpl() {
exit(1);
}
if (sayMsgLength > 0) {
if (recv(newsockfd, &sayMsgBuffer[0], sayMsgLength, 0) < 0){
perror("[Agent Server] ERROR recv say message from socket");
close(sockfd);
......@@ -510,9 +506,6 @@ void Agent::actionImpl() {
// [Sanmit] "Say" in the actual game
addSayMessage(new CustomMessage(msgString));
std::cout << "\n\n[AGENT SERVER] " << msgString << std::endl;
}
......
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