Ejemplo n.º 1
0
 public String getTransitionsOfBundleAsString(Bundle b) {
   String result = "";
   for (BundledTransition t : b.getTransitions()) {
     if (result != "") {
       result += ", ";
     }
     result += getName(t);
   }
   return result;
 }
Ejemplo n.º 2
0
  private void splitBundlesByLocalities(ArrayList<Node> nodes) {
    HashMap<Bundle, HashSet<BundledTransition>> subBundles = new HashMap<>();
    for (Node node : nodes) {
      if (node instanceof BundledTransition) {
        BundledTransition t = (BundledTransition) node;
        for (Bundle b : getBundlesOfTransition(t)) {
          HashSet<BundledTransition> transitions = subBundles.get(b);
          if (transitions == null) {
            transitions = new HashSet<BundledTransition>();
            subBundles.put(b, transitions);
          }
          transitions.add(t);
        }
      }
    }

    for (Bundle b : subBundles.keySet()) {
      HashSet<BundledTransition> transitions = subBundles.get(b);
      if (b.getTransitions().size() > transitions.size()) {
        bundleTransitions(transitions);
        b.removeAll(subBundles.get(b));
      }
    }
  }