Package jmt.gui.common.routingStrategies

Examples of jmt.gui.common.routingStrategies.ProbabilityRouting


      output.setConnected(key, routerKey, true);
    }

    // Sets routing for router
    for (int i = 0; i < classKeys.length; i++) {
      ProbabilityRouting pr = new ProbabilityRouting();
      output.setRoutingStrategy(routerKey, classKeys[i], pr);
      for (int j = 0; j < stationKeys.length; j++) {
        pr.getValues().put(stationKeys[j], new Double(visits[j][i] / visitSum[i]));
      }

      // Sets refRouter as reference station for closed class, sets its routing and avoid put jobs into sink
      if (output.getClassType(classKeys[i]) == CommonConstants.CLASS_TYPE_CLOSED) {
        output.setClassRefStation(classKeys[i], refRouterKey);
        pr.getValues().put(refRouterKey, new Double(1 / visitSum[i]));
        if (sinkKey != null) {
          pr.getValues().put(sinkKey, new Double(0.0));
        }
      }
      // Sets source as reference station for open class and sets sink routing, avoid routing to refRouter
      else {
        output.setClassRefStation(classKeys[i], sourceKey);
        pr.getValues().put(sinkKey, new Double(1 / visitSum[i]));
        if (refRouterKey != null) {
          pr.getValues().put(refRouterKey, new Double(0.0));
        }
      }
    }

    // Create measures
View Full Code Here


          Object thisClass = classes.get(j);
          //check if the routing strategy in thisStation is ProbabilityRouting
          if (getRoutingStrategy(thisStation, thisClass) instanceof ProbabilityRouting) {
            //if it is so, normalize routing probabilities
            Vector<Object> outputKeys = getForwardConnections(thisStation);
            ProbabilityRouting pr = (ProbabilityRouting) getRoutingStrategy(thisStation, thisClass);
            Map<Object, Double> values = pr.getValues();
            normalizeProbabilities(values, outputKeys, thisClass, thisStation);
          }
        }
      }
    }
View Full Code Here

TOP

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

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.