System.err.println("Sending from " + sender.getPhaseExecutions() + " (" + (sender.getPhaseExecutions()+maxLat+1) + ") to " + sdep.data[i].getDstPhase4SrcPhase(sender.getPhaseExecutions()+maxLat+1));
    public void enqueueMessage(Stream sender, String handlerName, Object[] args) {        // setup scheduler if it's not ready yet (have to do it here        // instead of constructor because scheduler depends on        // structure of stream graph, which is not ready at the time        // this is constructed.)        if (this.scheduler==null) {            this.scheduler = streamit.scheduler2.constrained.Scheduler.createForSDEP(new Iterator(Stream.toplevel));        }        // get SDEP to receivers        SDEPInfo sdep = getSDEP(sender);        // for each receiver...        for (int i=0; i<receivers.size(); i++) {            Stream receiver = (Stream)receivers.get(i);            // make message -- for now just send with maximum latency            // to make it easiest to schedule            Message m;            if (sdep.isDownstream[i]) {                // schedule downstream messages using DstPhase4Src.                System.err.println("Sending from " + sender.getPhaseExecutions() + " (" + (sender.getPhaseExecutions()+maxLat+1) + ") to " + sdep.data[i].getDstPhase4SrcPhase(sender.getPhaseExecutions()+maxLat+1));                m = new Message(sdep.data[i].getDstPhase4SrcPhase(sender.getPhaseExecutions()+maxLat+1),                                handlerName, args);            } else {                // schedule upstream messages messages using SrcPhase4Dst                m = new Message(sdep.data[i].getSrcPhase4DstPhase(sender.getPhaseExecutions()+maxLat+1),                                handlerName, args);            }            //System.err.println("Enqueuing message <" + handlerName + "> for deliver at time " + m.getDeliveryTime() + " in " + receiver);            // enqueue message            receiver.enqueueMessage(m);        }    }