Exemple #1
0
  /**
   * The remote vertex is scheduled for activation unless it has already been visited.
   *
   * <p>Note: We are scattering to out-edges. Therefore, this vertex is {@link
   * Statement#getSubject()}. The remote vertex is {@link Statement#getObject()}.
   */
  @Override
  public void scatter(
      final IGASState<PATHS.VS, PATHS.ES, Void> state,
      final IGASScheduler sch,
      final Value u,
      final Statement e) {

    // remote vertex state.
    final Value v = state.getOtherVertex(u, e);

    final VS otherState = state.getState(v);

    final int otherDepth = otherState.depth();
    //        final VS otherState = state.getState(e.getObject()/* v */);

    // visit.

    if (otherState.visit(state.round() + 1, u /* predecessor */, e.getPredicate())) {

      /*
       * This is the first visit for the remote vertex. Add it to the
       * schedule for the next iteration.
       */

      sch.schedule(v);
    }
  }