Commit 3d5dbf1f authored by drallensmith's avatar drallensmith

One last try before really rethinking

parent 475ccb90
...@@ -111,8 +111,15 @@ def do_defense_action(state_vec, hfo_env, episode, ...@@ -111,8 +111,15 @@ def do_defense_action(state_vec, hfo_env, episode,
hfo_env.act(hfo.MOVE) hfo_env.act(hfo.MOVE)
return return
if ball_toward_goal and (ball_sorted_list[0][1] < params['LOW_KICK_DIST']): goal_sorted_list = get_sorted_opponents(state_vec, num_opponents, num_teammates,
ball_toward_goal = False pos_x=GOAL_POS_X, pos_y=GOAL_POS_Y)
if ball_toward_goal:
if ball_sorted_list[0][1] < params['LOW_KICK_DIST']:
ball_toward_goal = False
elif goal_sorted_list[0][1] < get_dist_normalized(ball_pos_x,ball_pos_y,
GOAL_POS_X,GOAL_POS_Y):
ball_toward_goal = False
is_tackleable_opp = is_tackleable(agent_pos_x, agent_pos_y, is_tackleable_opp = is_tackleable(agent_pos_x, agent_pos_y,
ball_sorted_list[0][1], ball_sorted_list[0][1],
...@@ -156,8 +163,6 @@ def do_defense_action(state_vec, hfo_env, episode, ...@@ -156,8 +163,6 @@ def do_defense_action(state_vec, hfo_env, episode,
return return
if ball_sorted_list[0][1] < params['KICK_DIST']: if ball_sorted_list[0][1] < params['KICK_DIST']:
goal_sorted_list = get_sorted_opponents(state_vec, num_opponents, num_teammates,
pos_x=GOAL_POS_X, pos_y=GOAL_POS_Y)
if goal_sorted_list[0][0] != ball_sorted_list[0][0]: # top in each are opponents to worry about if goal_sorted_list[0][0] != ball_sorted_list[0][0]: # top in each are opponents to worry about
if is_in_open_area(ball_sorted_list[0][2],ball_sorted_list[0][3]) and (goal_sorted_list[0][1] if is_in_open_area(ball_sorted_list[0][2],ball_sorted_list[0][3]) and (goal_sorted_list[0][1]
< params['KICK_DIST']): < params['KICK_DIST']):
...@@ -195,8 +200,7 @@ def do_defense_action(state_vec, hfo_env, episode, ...@@ -195,8 +200,7 @@ def do_defense_action(state_vec, hfo_env, episode,
hfo_env.act(hfo.GO_TO_BALL) hfo_env.act(hfo.GO_TO_BALL)
return return
goal_sorted_list = get_sorted_opponents(state_vec, num_opponents, num_teammates,
pos_x=GOAL_POS_X, pos_y=GOAL_POS_Y)
if is_in_open_area(goal_sorted_list[0][2], goal_sorted_list[0][3]): if is_in_open_area(goal_sorted_list[0][2], goal_sorted_list[0][3]):
hfo_env.act(hfo.MOVE) hfo_env.act(hfo.MOVE)
elif goal_sorted_list[0][1] < min(params['KICK_DIST'], elif goal_sorted_list[0][1] < min(params['KICK_DIST'],
......
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