Commit 5c51529a authored by Matthew Hausknecht's avatar Matthew Hausknecht

Added high-level catch action.

parent e1f0e319
......@@ -22,12 +22,13 @@ class HFO_Actions:
[High-Level] Shoot(): Shoot the ball
[High-Level] Pass(teammate_unum): Pass to teammate
[High-Level] Dribble(): Offensive dribble
[High-Level] Catch(): Catch the ball (Goalie Only)
NOOP(): Do Nothing
QUIT(): Quit the game
'''
DASH, TURN, TACKLE, KICK, KICK_TO, MOVE_TO, DRIBBLE_TO, INTERCEPT, \
MOVE, SHOOT, PASS, DRIBBLE, NOOP, QUIT = range(14)
MOVE, SHOOT, PASS, DRIBBLE, CATCH, NOOP, QUIT = range(15)
class HFO_Status:
''' Current status of the HFO game. '''
......@@ -59,6 +60,7 @@ class HFOEnvironment(object):
HFO_Actions.SHOOT : 0,
HFO_Actions.PASS : 1,
HFO_Actions.DRIBBLE : 0,
HFO_Actions.CATCH : 0,
HFO_Actions.NOOP : 0,
HFO_Actions.QUIT : 0}.get(action_type, -1);
......
......@@ -41,6 +41,12 @@ std::string HFOEnvironment::ActionToString(Action action) {
case DRIBBLE:
ss << "Dribble";
break;
case CATCH:
ss << "Catch";
break;
case NOOP:
ss << "No-op";
break;
case QUIT:
ss << "Quit";
break;
......@@ -74,6 +80,8 @@ int HFOEnvironment::NumParams(action_t action) {
return 1;
case DRIBBLE:
return 0;
case CATCH:
return 0;
case NOOP:
return 0;
case QUIT:
......
......@@ -29,6 +29,7 @@ enum action_t
SHOOT, // [High-Level] Shoot(): Shoot the ball
PASS, // [High-Level] Pass(teammate_unum [0,11]): Pass to the most open teammate
DRIBBLE, // [High-Level] Dribble(): Offensive dribble
CATCH, // [High-Level] Catch(): Catch the ball (Goalie only!)
NOOP, // Do nothing
QUIT // Special action to quit the game
};
......
......@@ -496,6 +496,9 @@ void Agent::actionImpl() {
case DRIBBLE:
this->doDribble();
break;
case CATCH:
this->doCatch();
break;
case NOOP:
break;
case QUIT:
......
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