Method skeleton for nearest neighbors, also helper functions in tilingRL agent