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