code: private Iterator<DiEdge> edges(Schedule s) {
          Iterator<Integer> ixIter = s.iterator();
          return new Iterator<DiEdge>() {
              
              @Override
              public DiEdge next() {
                  return edgesToNodes.lookupObject(ixIter.next());
              }
              
              @Override
              public boolean hasNext() {
                  return ixIter.hasNext();
              }
          };
      }
docs: /*
  TODO: probably better to just have halt be explicit as an int rather than an action
  private Pair<Iterator<DiEdge>, Integer> filterOutStopTime(Schedule s) {
  int haltTime = -1;
  List<DiEdge> nonStopActions = new LinkedList<>();
  for (Indexed<Integer> a : enumerate(s)) {
  if (a.get() == haltAction) {
  if (haltTime > -1) {
  throw new IllegalStateException("cannot have more than one halt action in schedule");
  }
  haltTime = a.index();
  } else {
  nonStopActions.add(edgesToNodes.lookupObject(a.get()));
  }
  }
  if (haltTime == -1) {
  haltTime = nonStopActions.size();
  }
  return new Pair<>(nonStopActions.iterator(), haltTime);
  }