Package ptolemy.actor

Examples of ptolemy.actor.Actor


     *  refined step size from enabled transition.
     *  @return The refined step size.
     */
    public double refinedStepSize() {
        Case container = (Case) getContainer();
        Actor refinement = container.getCurrentRefinement();
        if (refinement instanceof CTStepSizeControlActor) {
            return ((CTStepSizeControlActor) refinement).refinedStepSize();
        }
        CTGeneralDirector executiveDirector = getExecutiveCTGeneralDirector();
        return executiveDirector.getCurrentStepSize();
View Full Code Here


        CTSchedule schedule = _getSchedule();
        Iterator actors = schedule.get(CTSchedule.DYNAMIC_ACTORS)
                .actorIterator();

        while (actors.hasNext()) {
            Actor next = (Actor) actors.next();

            if (_debugging) {
                _debug("  firing..." + ((Nameable) next).getFullName());
            }

            next.fire();
        }

        // Time must be advanced after all dynamic actors are fired.
        _advanceModelTime();
    }
View Full Code Here

        CTSchedule schedule = _getSchedule();
        Iterator actors = schedule.get(CTSchedule.STATE_TRANSITION_ACTORS)
                .actorIterator();

        while (actors.hasNext()) {
            Actor next = (Actor) actors.next();
            if (!next.prefire()) {
                throw new IllegalActionException(
                        next,
                        "Expected prefire() to return true!\n"
                                + "Perhaps a continuous input is being driven by a "
                                + "discrete output?");
            } else {
                if (_debugging) {
                    _debug("  firing..." + ((Nameable) next).getFullName());
                }
                next.fire();
            }
        }
    }
View Full Code Here

        }

        // Next do the output ports of all contained actors.
        Iterator actors = container.deepEntityList().iterator();
        while (actors.hasNext()) {
            Actor actor = (Actor) actors.next();
            Iterator outputPorts = actor.outputPortList().iterator();
            while (outputPorts.hasNext()) {
                IOPort outputPort = (IOPort) (outputPorts.next());
                result.append("Send from " + outputPort.getFullName() + "\n");
                Receiver[][] destinations = outputPort.getRemoteReceivers();
                for (int channel = 0; channel < destinations.length; channel++) {
View Full Code Here

     */
    public void emitCurrentStates() throws IllegalActionException {
        Iterator actors = _enabledRefinements.iterator();

        while (actors.hasNext()) {
            Actor actor = (Actor) actors.next();

            if (actor instanceof CTCompositeActor) {
                ((CTCompositeActor) actor).emitCurrentStates();
            }
        }
View Full Code Here

            // Fire the refinements of the current state.
            Iterator actors = _enabledRefinements.iterator();

            while (actors.hasNext()) {
                Actor actor = (Actor) actors.next();

                if (_debugging && _verbose) {
                    _debug(getName(), " fire refinement", ((NamedObj) actor)
                            .getName());
                }

                // If this is the first time this state is visited, check
                // whether the director for the refinement is a CT (Embedded)
                // director. If so, establish the initial states for this
                // refinement.
                if (!visited) {
                    Director director = actor.getDirector();

                    if (director instanceof CTEmbeddedDirector) {
                        ((CTEmbeddedDirector) director)
                                .setInitialStatesNotReady();
                    }
                }

                actor.fire();
            }

            // The controller needs to know the most updated outputs from
            // the firing of the enabled refinements.
            ctrl.readOutputsFromRefinement();
View Full Code Here

     */
    public void goToMarkedState() throws IllegalActionException {
        Iterator actors = _enabledRefinements.iterator();

        while (actors.hasNext()) {
            Actor actor = (Actor) actors.next();

            if (actor instanceof CTCompositeActor) {
                ((CTCompositeActor) actor).goToMarkedState();
            }
        }
View Full Code Here

    public boolean hasCurrentEvent() {
        boolean eventPresent = false;
        Iterator actors = _enabledRefinements.iterator();

        while (!eventPresent && actors.hasNext()) {
            Actor actor = (Actor) actors.next();

            if (actor instanceof CTCompositeActor) {
                eventPresent |= ((CTCompositeActor) actor).hasCurrentEvent();
            }
        }
View Full Code Here

            Iterator firings = level.firingIterator();

            while (firings.hasNext()) {
                Firing firing = (Firing) firings.next();
                Actor actor = firing.getActor();
                ClientThread clientThread = (ClientThread) actorsThreadsMap
                        .get(actor);
                clientThread.setIterationCount(firing.getIterationCount());
                commandsMap.put(clientThread, Integer
                        .valueOf(ClientThread.ITERATE));
            }

            int aux = levelNumber - iterationsValue;

            if (aux >= 0) {
                firings = schedule.get(aux).firingIterator();

                while (firings.hasNext()) {
                    Firing firing = (Firing) firings.next();
                    Actor actor = firing.getActor();

                    System.out.println("removing: " + actor.getFullName());
                    ClientThread clientThread = (ClientThread) actorsThreadsMap
                            .get(actor);
                    clientThread.setIterationCount(firing.getIterationCount());
                    commandsMap.remove(clientThread);
                }
View Full Code Here

    public boolean isOutputAccurate() {
        boolean result = true;

        // Iterate all the enabled refinements to see whether they are
        // satisfied with the current step size.
        Actor container = (Actor) getContainer();
        CTDirector dir = (CTDirector) (container.getExecutiveDirector());

        if (_enabledRefinements != null) {
            Iterator refinements = _enabledRefinements.iterator();

            while (refinements.hasNext()) {
                Actor refinement = (Actor) refinements.next();

                if (refinement instanceof CTStepSizeControlActor) {
                    result = result
                            && ((CTStepSizeControlActor) refinement)
                                    .isOutputAccurate();
View Full Code Here

TOP

Related Classes of ptolemy.actor.Actor

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.