nIters = 0;
    public void run(String args[])    {        boolean scheduledRun = true;        boolean printGraph = false;        boolean doRun = true;        int nIters = -1;        // read the args:        if (args != null)        {            int length = args.length;            int index;            for (index = 0; index < length; index++)            {                if (args[index].equals("-nosched"))                {                    scheduledRun = false;                }                else if (args[index].equals("-printgraph"))                {                    printGraph = true;                }                else if (args[index].equals("-i"))                {                    index++;                    nIters = Integer.valueOf(args[index]).intValue();                }                else if (args[index].equals("-printdot"))                {                    printdot = true;                }                else if (args[index].equals("-norun"))                {                    doRun = false;                }                else                {                    ERROR("Unrecognized argument: " + args[index] + ".");                }            }        }        setupOperator();        ASSERT(            getInputChannel() == null,            "The toplevel stream can't have any input or output channels,\n"                + "but in this program there is an input to the first filter.");        ASSERT(            getOutputChannel() == null,            "The toplevel stream can't have any input or output channels,\n"                + "but in this program there is an output of the last filter.");        // setup the scheduler        if (printGraph)        {            // this is not implemented yet.  when I'm done with            // some certain amount of the scheduler, I can start            // using the iterators to do this properly.            ASSERT(false);        }        if (!doRun)            System.exit(0);        // setup the scheduler        if (scheduledRun)        {            {                HashSet x = new HashSet (),y = new HashSet ();                Integer a = new Integer (9), b = new Integer (9);                ASSERT (a != b);                x.add (a);                y.add (b);                ASSERT (x.equals (y));                HashSet z = new HashSet ();                z.add (a);                ASSERT (z.contains (b));                z.add (x);                ASSERT (z.contains (y));                                HashMap i = new HashMap ();                i.put(x,a);                ASSERT (i.get(y));                i.put(a,x);                ASSERT (i.get(b));                                System.out.println ("OK");                //System.exit (0);                            }            // not implemented yet. waiting for the scheduler to            // be done.            Iterator selfIter = new streamit.iriter.Iterator(this);            StreamFactory factory = new StreamFactory();            StreamInterface selfStream = factory.newFrom(selfIter);            selfStream.computeSchedule();            Schedule initSched = selfStream.getInitSchedule();            Schedule steadySched = selfStream.getSteadySchedule();                        ScheduleBuffers buffers = new ScheduleBuffers(selfIter);            buffers.computeBuffersFor(initSched);            buffers.computeBuffersFor(steadySched);            // write equals and hashCode functions for operators!            // this will solve all equality problems.            /*            scheduler = new SimpleHierarchicalScheduler ();                        SchedStream stream;            stream = (SchedStream) constructSchedule ();            ASSERT (stream);                        scheduler.useStream (stream);            scheduler.computeSchedule ();            */            // setup the buffer lengths for the stream setup here:            setupBufferLengths(buffers);            /*            System.out.print ("[");            this.computeSize(initSched, true);            System.out.println ("]");            System.out.println ("[");            this.computeSize(steadySched, true);            System.out.println ("]");            System.out.println ("sched size = " + totalSize);            System.out.println ("buff size = " + totalBuffer);            System.out.println ("nodex = " + selfStream.getNumNodes());            System.out.println ("node firings = " + selfStream.getNumNodeFirings());            */                        // run the init schedule:            runSchedule(initSched);            nIters = 0;            // and run the steady schedule forever:            while (nIters != 0)            {                runSchedule(steadySched);                if (nIters > 0)                    nIters--;            }        }        else        {            while (true)            {                runSinks();                drainChannels();            }        }    }