Пример #1
0
  /**
   * @return true if we need switch code for this graph, otherwise we can just use the dynamic
   *     network because there are no overlapping routes and no splitters or joiners
   */
  public static boolean needSimulator(SpdStaticStreamGraph ssg) {
    // check if there are any overlapping routes...
    if (((SpdStreamGraph) ssg.getStreamGraph()).getLayout().getIntermediateTiles().size() > 0)
      return true;

    // check if there are any splitters...
    Iterator it = ssg.getFlatNodes().iterator();
    while (it.hasNext()) {
      FlatNode node = (FlatNode) it.next();
      if (node.isJoiner() || node.isSplitter()) return true;
    }
    // all's good!
    return false;
  }