code: def get_rank(self, entity, criteria, condition = True):
          entity = entity if not isinstance(entity, Projector) else entity.reference_entity
          positions = entity.members_position
          biggest_entity_size = np.max(positions) + 1
          filtered_criteria = np.where(condition, criteria, np.inf)
          ids = entity.members_entity_id
          matrix = np.asarray([
              entity.value_nth_person(k, filtered_criteria, default = np.inf)
              for k in range(biggest_entity_size)
              ]).transpose()
          sorted_matrix = np.argsort(np.argsort(matrix))
          result = sorted_matrix[ids, positions]
          return np.where(condition, result, -1)