currantBatchRange method

List<int> currantBatchRange()

@en: Retrieve the index range of the current batch in the vertex collection

@zh: 获取当前批在节点集合中的下标范围

Implementation

List<int> currantBatchRange() {
  var batchLen = graph.vertexes.length ~/ perBatchTotal + 1;
  batchIndex = (batchIndex % batchLen).toInt();
  var start = batchIndex * perBatchTotal;
  var end = (batchIndex + 1) * perBatchTotal < graph.vertexes.length
      ? (batchIndex + 1) * perBatchTotal
      : graph.vertexes.length;
  return [start, end];
}