//... if it has not been explored yet ...
if (!alreadyVisited.contains(thisForwardStation)) {
//... add the element to the alreadyVisited vector ...
alreadyVisited.add(thisForwardStation);
// ... get the routing strategy for the class in the starting station ...
RoutingStrategy strategy = (RoutingStrategy) station_def.getRoutingStrategy(startingStationKey, classKey);
// ... if thisForwardStation is a Sink ...
if (station_def.getStationType(thisForwardStation).equals(STATION_TYPE_SINK)) {
// ... if the routing strategy is the Probability Routing ...
if (strategy instanceof ProbabilityRouting) {
Map probabilities = strategy.getValues();
// ... get the routing probability toward thisForwardStation ...
double p = ((Double) probabilities.get(thisForwardStation)).doubleValue();
// ... if p = 1 there is an error, put startingStationKey into the
// toBeReturned vector ...
if (p == 1) {
toBeReturned.add(startingStationKey);
}
}
}
// ... else thisForwardStation isn't a Sink ...
else {
Vector<Object> temp;
// ... if the routing policy is ProbabilityRouting ...
if (strategy instanceof ProbabilityRouting) {
Map probabilities = strategy.getValues();
// ... get the routing probability toward thisForwardStation ...
double p = ((Double) probabilities.get(thisForwardStation)).doubleValue();
// ... if p != 0 start exploring from thisForwardStation and collect
// the returned vector into temp ...
if (p != 0) {