} }*/
} */
    private static void createExecutionCounts(SIRStream str,                                              GraphFlattener graphFlattener) {        // make fresh hashmaps for results        HashMap[] result = { initExecutionCounts = new HashMap(),                              steadyExecutionCounts = new HashMap()} ;        // then filter the results to wrap every filter in a flatnode,        // and ignore splitters        for (int i=0; i<2; i++) {            for (Iterator it = executionCounts[i].keySet().iterator();                 it.hasNext(); ){                SIROperator obj = (SIROperator)it.next();                int val = ((int[])executionCounts[i].get(obj))[0];                //System.err.println("execution count for " + obj + ": " + val);                /* This bug doesn't show up in the new version of                 * FM Radio - but leaving the comment here in case                 * we need to special case any other scheduler bugsx.                          if (val==25) {                  System.err.println("Warning: catching scheduler bug with special-value "                 + "overwrite in RawBackend");                 val=26;                 }                 if ((i == 0) &&                 (obj.getName().startsWith("Fused__StepSource") ||                 obj.getName().startsWith("Fused_FilterBank")))                 val++;                */                if (graphFlattener.getFlatNode(obj) != null)                    result[i].put(graphFlattener.getFlatNode(obj),                                   new Integer(val));            }        }            //Schedule the new Identities and Splitters introduced by GraphFlattener        for(int i=0;i<GraphFlattener.needsToBeSched.size();i++) {            FlatNode node=(FlatNode)GraphFlattener.needsToBeSched.get(i);            int initCount=-1;            if(node.incoming.length>0) {                if(initExecutionCounts.get(node.incoming[0])!=null)                    initCount=((Integer)initExecutionCounts.get(node.incoming[0])).intValue();                if((initCount==-1)&&(executionCounts[0].get(node.incoming[0].contents)!=null))                    initCount=((int[])executionCounts[0].get(node.incoming[0].contents))[0];            }            int steadyCount=-1;            if(node.incoming.length>0) {                if(steadyExecutionCounts.get(node.incoming[0])!=null)                    steadyCount=((Integer)steadyExecutionCounts.get(node.incoming[0])).intValue();                if((steadyCount==-1)&&(executionCounts[1].get(node.incoming[0].contents)!=null))                    steadyCount=((int[])executionCounts[1].get(node.incoming[0].contents))[0];            }            if(node.contents instanceof SIRIdentity) {                if(initCount>=0)                    initExecutionCounts.put(node,new Integer(initCount));                if(steadyCount>=0)                    steadyExecutionCounts.put(node,new Integer(steadyCount));            } else if(node.contents instanceof SIRSplitter) {                //System.out.println("Splitter:"+node);                int[] weights=node.weights;                FlatNode[] edges=node.edges;                int sum=0;                for(int j=0;j<weights.length;j++)                    sum+=weights[j];                for(int j=0;j<edges.length;j++) {                    if(initCount>=0)                        initExecutionCounts.put(edges[j],new Integer((initCount*weights[j])/sum));                    if(steadyCount>=0)                        steadyExecutionCounts.put(edges[j],new Integer((steadyCount*weights[j])/sum));                }                if(initCount>=0)                    result[0].put(node,new Integer(initCount));                if(steadyCount>=0)                    result[1].put(node,new Integer(steadyCount));            } else if(node.contents instanceof SIRJoiner) {                FlatNode oldNode=graphFlattener.getFlatNode(node.contents);                if(executionCounts[0].get(node.oldContents)!=null)                    result[0].put(node,new Integer(((int[])executionCounts[0].get(node.oldContents))[0]));                if(executionCounts[1].get(node.oldContents)!=null)                    result[1].put(node,new Integer(((int[])executionCounts[1].get(node.oldContents))[0]));            }        }            /*        //now, in the above calculation, an execution of a joiner node is         //considered one cycle of all of its inputs.  For the remainder of the        //raw backend, I would like the execution of a joiner to be defined as        //the joiner passing one data item down stream        for (int i=0; i < 2; i++) {        Iterator it = result[i].keySet().iterator();        while(it.hasNext()){        FlatNode node = (FlatNode)it.next();        if (node.contents instanceof SIRJoiner) {        int oldVal = ((Integer)result[i].get(node)).intValue();        int cycles=oldVal*((SIRJoiner)node.contents).oldSumWeights;        if((node.schedMult!=0)&&(node.schedDivider!=0))        cycles=(cycles*node.schedMult)/node.schedDivider;        result[i].put(node, new Integer(cycles));        }        if (node.contents instanceof SIRSplitter) {        int sum = 0;        for (int j = 0; j < node.ways; j++)        sum += node.weights[j];        int oldVal = ((Integer)result[i].get(node)).intValue();        result[i].put(node, new Integer(sum*oldVal));        //System.out.println("SchedSplit:"+node+" "+i+" "+sum+" "+oldVal);        }        }        }        */            //The following code fixes an implementation quirk of two-stage-filters        //in the *FIRST* version of the scheduler.  It is no longer needed,        //but I am keeping it around just in case we every need to go back to the old        //scheduler.            //increment the execution count for all two-stage filters that have         //initpop == initpush == 0, do this for the init schedule only        //we must do this for all the two-stage filters,         //so iterate over the keyset from the steady state         /*  Iterator it = result[1].keySet().iterator();            while(it.hasNext()){            FlatNode node = (FlatNode)it.next();            if (node.contents instanceof SIRTwoStageFilter) {            SIRTwoStageFilter two = (SIRTwoStageFilter) node.contents;            if (two.getInitPush() == 0 &&            two.getInitPop() == 0) {            Integer old = (Integer)result[0].get(node);            //if this 2-stage was not in the init sched            //set the oldval to 0            int oldVal = 0;            if (old != null)            oldVal = old.intValue();            result[0].put(node, new Integer(1 + oldVal));               }            }            }*/    }