Package ptolemy.actor.sched

Examples of ptolemy.actor.sched.Scheduler


     *  one of the associated actors throws it.
     */
    public void preinitialize() throws IllegalActionException {
        super.preinitialize();

        Scheduler scheduler = getScheduler();

        if (scheduler == null) {
            throw new IllegalActionException("Attempted to initialize "
                    + "GR system with no scheduler");
        }

        // force the schedule to be computed.
        if (_debugging) {
            _debug("Computing schedule");
        }

        try {
            scheduler.getSchedule();
        } catch (Exception ex) {
            throw new IllegalActionException(this, ex,
                    "Failed to compute schedule:");
        }
    }
View Full Code Here


    /** Create an actor table that caches all the actors directed by this
     *  director.  This method is called once in initialize().
     *  @exception IllegalActionException If the scheduler is null.
     */
    private void _buildActorTable() throws IllegalActionException {
        Scheduler currentScheduler = getScheduler();

        if (currentScheduler == null) {
            throw new IllegalActionException(this, "Attempted to fire "
                    + "GR system with no scheduler");
        }

        currentScheduler.getSchedule();
        _debugViewActorTable();
    }
View Full Code Here

        if (container == null) {
            throw new InvalidStateException(this, getName()
                    + " fired, but it has no container!");
        }

        Scheduler scheduler = getScheduler();

        if (scheduler == null) {
            throw new IllegalActionException(this, "Attempted to fire "
                    + "GR system with no scheduler");
        }

        Schedule schedule = scheduler.getSchedule();

        Iterator actors = schedule.actorIterator();

        while (actors.hasNext()) {
            Actor actor = (Actor) actors.next();
View Full Code Here

    private void bufferingPhase() throws IllegalActionException {
        System.out.println("Buffering...");

        int iterationsValue = ((IntToken) (iterations.getToken())).intValue();

        Scheduler scheduler = getScheduler();

        if (scheduler == null) {
            throw new IllegalActionException("Attempted to fire "
                    + "system with no scheduler");
        }

        // This will throw IllegalActionException if this director
        // does not have a container.
        Schedule schedule = scheduler.getSchedule();
        Iterator levels = schedule.iterator();

        int levelNumber = 0;

        commandsMap = new HashMap();
View Full Code Here

     @see ptolemy.distributed.client.ThreadSynchronizer
     *  @exception IllegalActionException If port methods throw it.
     */
    private void parallelFire() throws IllegalActionException {
        //        System.out.println("ParallelFire");
        Scheduler scheduler = getScheduler();

        if (scheduler == null) {
            throw new IllegalActionException("Attempted to fire "
                    + "system with no scheduler");
        }

        // This will throw IllegalActionException if this director
        // does not have a container.
        Schedule schedule = scheduler.getSchedule();
        Iterator levels = schedule.iterator();

        while (levels.hasNext() && !_stopRequested) {
            Schedule level = (Schedule) levels.next();
            Iterator firings = level.firingIterator();
View Full Code Here

     @exception IllegalActionException If port methods throw it.
     */
    private void pipelinedParallelFire() throws IllegalActionException {
        int iterationsValue = ((IntToken) (iterations.getToken())).intValue();

        Scheduler scheduler = getScheduler();

        if (scheduler == null) {
            throw new IllegalActionException("Attempted to fire "
                    + "system with no scheduler");
        }

        // This will throw IllegalActionException if this director
        // does not have a container.
        Schedule schedule = scheduler.getSchedule();

        //        System.out.println("Schedule size:" + schedule.size());
        int aux = iterationsValue - _iterationCount;

        if (aux < schedule.size()) {
View Full Code Here

                            _debug("Waiting for real time to pass: "
                                    + timeToWait);
                        }

                        // Synchronize on the scheduler.
                        Scheduler scheduler = getScheduler();

                        synchronized (scheduler) {
                            try {
                                scheduler.wait(timeToWait);
                            } catch (InterruptedException ex) {
                                // Continue executing.
                            }
                        }
                    }
View Full Code Here

TOP

Related Classes of ptolemy.actor.sched.Scheduler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.