def move_up(obs): army = scaux.select_army(obs, sc2_env.Race.terran) xs = [unit.x for unit in army] ys = [unit.y for unit in army] new_army_x = int(mean(xs)) new_army_y = int(mean(ys)) - VER_THRESHOLD for unit in army: PENDING_ACTIONS.append(actions.RAW_FUNCTIONS.Move_pt("now", unit.tag, [new_army_x, new_army_y]))
def print_army_mean(obs): army = scaux.select_army(obs, sc2_env.Race.terran) xs = [unit.x for unit in army] ys = [unit.y for unit in army] print("Army position is [{x}, {y}]".format(x=int(mean(xs)),y=int(mean(ys))))