ComputeNode srcTile = getComputeNode(src); ComputeNode dstTile = getComputeNode(dst);
ComputeNode srcTile; try { srcTile = getComputeNode(src); } catch (AssertionError e) { srcTile = getComputeNode(Util.getFilterUpstreamAssigned(this,src)); } ComputeNode dstTile; try { dstTile = getComputeNode(dst); } catch (AssertionError e) { dstTile = getComputeNode(Util.getFilterDownstreamAssigned(this,dst)); }
    private double getDynamicCost(SpdStaticStreamGraph ssg, HashSet usedTiles) {        double cost = 0.0;        // check if the dynamic communication is legal        for (int j = 0; j < ssg.getOutputs().length; j++) {            FlatNode src = ssg.getOutputs()[j];            FlatNode dst = ssg.getNext(src);            int typeSize = Util.getTypeSize(ssg.getOutputType(src));            ComputeNode srcTile = getComputeNode(src);            ComputeNode dstTile = getComputeNode(dst);            Iterator route = XYRouter.getRoute(ssg, srcTile, dstTile)                .iterator();            // System.out.print("Dynamic Route: ");            // ********* TURNS IN DYNAMIC NETWORK COST IN TERMS OF LATENCY            // ****//            if (srcTile.getX() != dstTile.getX()                && srcTile.getY() != dstTile.getY())                cost += (1.0 * typeSize);            // ** Don't share links, could lead to starvation?? ***///            while (route.hasNext()) {                ComputeNode tile = (ComputeNode) route.next();                assert tile != null;                if (usedTiles.contains(tile)) // this tile already used to                    // dynamic route                    cost += DYN_CROSSED_ROUTE; // ILLEGAL_WEIGHT/(DYN_MULT *                // 100);                else                    usedTiles.add(tile);                // System.out.print(tile);                // add to cost only if these are not endpoints of the route                if (tile != srcTile && tile != dstTile) {                    cost += (1.0 * typeSize);                }            }        }        return cost;    }