Package ptolemy.actor

Examples of ptolemy.actor.CompositeActor


     */
    public void fire() throws IllegalActionException {
        super.fire();

        if (_model instanceof CompositeActor) {
            CompositeActor executable = (CompositeActor) _model;

            _manager = executable.getManager();

            if (_manager == null) {
                throw new InternalErrorException("No manager!");
            }

            if (_debugging) {
                _manager.addDebugListener(this);

                Director director = executable.getDirector();

                if (director != null) {
                    director.addDebugListener(this);
                }
            } else {
                _manager.removeDebugListener(this);

                Director director = executable.getDirector();

                if (director != null) {
                    director.removeDebugListener(this);
                }
            }
View Full Code Here


            try {
                str = (StringToken) modelString.get(0);

                _parser.reset();

                CompositeActor model = (CompositeActor) _parser.parse(str
                        .stringValue());
                StringWriter writer = new StringWriter();

                try {
                    model.exportMoML(writer, 1);
                } catch (Exception ex) {
                    // FIXME: don't ignore?
                }

                String modelMoML = writer.toString();

                if (((BooleanToken) connectPorts.getToken()).booleanValue()) {
                    _moml = "<group>\n" + modelMoML
                            + "<relation name=\"newR1\" "
                            + "class=\"ptolemy.actor.TypedIORelation\">\n"
                            + "</relation>\n" + "<relation name=\"newR2\" "
                            + "class=\"ptolemy.actor.TypedIORelation\">\n"
                            + "</relation>\n"
                            + "<link port=\"input\" relation=\"newR1\"/>\n"
                            + "<link port=\"" + model.getName()
                            + ".input\" relation=\"newR1\"/>\n"
                            + "<link port=\"" + model.getName()
                            + ".output\" relation=\"newR2\"/>\n"
                            + "<link port=\"output\" relation=\"newR2\"/>\n"
                            + "</group>";
                } else {
                    _moml = "<group>\n" + modelMoML + "</group>";
View Full Code Here

        // Set the flag to false for the next firing.
        _alreadyReadInputs = false;

        if (_model instanceof CompositeActor) {
            CompositeActor executable = (CompositeActor) _model;

            _manager = executable.getManager();

            if (_manager == null) {
                throw new InternalErrorException("No manager!");
            }

            if (_debugging) {
                _manager.addDebugListener(this);

                Director director = executable.getDirector();

                if (director != null) {
                    director.addDebugListener(this);
                }
            } else {
                _manager.removeDebugListener(this);

                Director director = executable.getDirector();

                if (director != null) {
                    director.removeDebugListener(this);
                }
            }
View Full Code Here

         *   actor is not opaque.
         */
        public void fire() throws IllegalActionException {
            // Don't call "super.fire();" here, this actor contains its
            // own director.
            CompositeActor container = (CompositeActor) getContainer();
            Iterator actors = container.entityList().iterator();
            _postfireReturns = true;

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

View Full Code Here

        // of the modal model that it contains may change rates after
        // making a change request, which invalidates this HDF's schedule.
        // So we need to get the schedule of this HDFDirector also in a
        // change request.
        if (!isScheduleValid() || (getContainer() != toplevel())) {
            CompositeActor container = (CompositeActor) getContainer();
            ChangeRequest request = new ChangeRequest(this, "reschedule") {
                protected void _execute() throws KernelException {
                    getScheduler().getSchedule();
                }
            };

            request.setPersistent(false);
            container.requestChange(request);
        }

        return super.postfire();
    }
View Full Code Here

     */
    public void initialize() throws IllegalActionException {
        super.initialize();
        _iterationCount = 0;

        CompositeActor container = (CompositeActor) getContainer();

        for (Iterator ports = container.outputPortList().iterator(); ports
                .hasNext();) {
            IOPort port = (IOPort) ports.next();

            // Create external initial production.
            int rate = DFUtilities.getTokenInitProduction(port);
View Full Code Here

        if (director == null) {
            return null;
        }

        // If there is no container, there are no actors
        CompositeActor container = (CompositeActor) (director.getContainer());

        if (container == null) {
            return null;
        }

        CompositeActor castContainer = container;

        // First, include all actors as nodes in the graph.
        // get all the contained actors.
        List entities = castContainer.deepEntityList();
        Iterator actors = entities.iterator();
        int actorCount = entities.size();

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

        actors = castContainer.deepEntityList().iterator();

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

            // Find the successors of the actor
View Full Code Here

        }

        // If a transition was taken, then request a refiring at the current time
        // in case the destination state is a transient state.
        if (_enabledTransition != null) {
            CompositeActor container = (CompositeActor) getContainer();
            Director executiveDirector = container.getExecutiveDirector();
            if (executiveDirector != null) {
                if (_debugging) {
                    _debug("ModalDirector: Request refiring by "
                            + executiveDirector.getFullName() + " at "
                            + getModelTime());
View Full Code Here

        }

        Iterator compositeActors = container.entityList(CompositeActor.class)
                .iterator();
        while (compositeActors.hasNext()) {
            CompositeActor compositeActor = (CompositeActor) compositeActors
                    .next();
            if (!(compositeActor instanceof Rollbackable)) {
                _checkpoint(handles, compositeActor);
            }
        }
View Full Code Here

        Scene.v().setFastHierarchy(new FastHierarchy());
    }

    public void copyAttributesOtherThanVariable(NamedObj object) {
        if (object instanceof CompositeActor) {
            CompositeActor model = (CompositeActor) object;

            // Loop over all the model instance classes.
            for (Iterator entities = model.deepEntityList().iterator(); entities
                    .hasNext();) {
                ComponentEntity entity = (ComponentEntity) entities.next();

                // recurse.
                copyAttributesOtherThanVariable(entity);
View Full Code Here

TOP

Related Classes of ptolemy.actor.CompositeActor

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.