Package jmt.gui.common.routingStrategies

Examples of jmt.gui.common.routingStrategies.RoutingStrategy


    }

    // Now adjusts Empirical Routing (if any) - Now named Probability Routing
    keys = tempkey.keySet().iterator();
    Object[] classes;
    RoutingStrategy rs;
    Map oldRouting, newRouting;
    // Search in every new inserted station
    while (keys.hasNext()) {
      newkey = tempkey.get(keys.next());
      classes = mediator.getClassDefinition().getClassKeys().toArray();
      for (Object classe : classes) {
        rs = (RoutingStrategy) mediator.getStationDefinition().getRoutingStrategy(newkey, classe);
        if (rs instanceof ProbabilityRouting) {
          oldRouting = rs.getValues();
          newRouting = new HashMap();
          // For each old destination, set new one if it was copied with
          Object[] oldDest = oldRouting.keySet().toArray();
          for (Object element : oldDest) {
            // Now checks if target station was copied with source one and a link connecting them exists
            if (tempkey.containsKey(element) && mediator.getStationDefinition().areConnected(newkey, tempkey.get(element))) {
              newRouting.put(tempkey.get(element), oldRouting.get(element));
            }
          }
          rs.getValues().clear();
          rs.getValues().putAll(newRouting);
        }
      }
    }

    // Selects every inserted element
View Full Code Here

TOP

Related Classes of jmt.gui.common.routingStrategies.RoutingStrategy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.