class_docstr: An agent specifically for solving the CollectMineralShards map.
class_docstr_tok: ["An","agent","specifically","for","solving","the","CollectMineralShards","map","."]
code: def step(self, obs):
      super(CollectMineralShards, self).step(obs)
      if FUNCTIONS.Move_screen.id in obs.observation.available_actions:
          player_relative = (
              obs.observation.feature_screen.player_relative
          )
          minerals = _xy_locs(player_relative == _PLAYER_NEUTRAL)
          if not minerals:
              return FUNCTIONS.no_op()
          marines = _xy_locs(player_relative == _PLAYER_SELF)
          marine_xy = numpy.mean(
              marines, axis=0
          ).round()  # Average location.
          distances = numpy.linalg.norm(
              numpy.array(minerals) - marine_xy, axis=1
          )
          closest_mineral_xy = minerals[numpy.argmin(distances)]
          return FUNCTIONS.Move_screen("now", closest_mineral_xy)
      else:
          return FUNCTIONS.select_army("select")
  
imports: import numpy
  from pysc2.agents import base_agent
  from pysc2.lib import actions
  from pysc2.lib import features
label_desc: Use image node_id 1 for calling the CollectMineralShards obj's underlying member method code with example usage: obj.step(obs) and returns: FUNCTIONS, FUNCTIONS, FUNCTIONS