code: def finalize(self):
          
          # todo sort self.result by path_num
          if self.result:
              self.result = sorted(self.result, key=lambda x: x[0])
              p, r = map(list, zip(*self.result))
              self.result = r
docs: finalize simulation for consumer