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

Added high-level catch action.

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