Package ptolemy.actor

Examples of ptolemy.actor.CompositeActor


     *  in the indicated referred set.
     *  @param portSet The given set of ports
     *  @param referredInputPorts The referred set.
     */
    public void getReferredInputPorts(Set portSet, Set referredInputPorts) {
        CompositeActor container = (CompositeActor) getContainer();
        List inputPortList = container.inputPortList();

        for (int i = 0; i < inputPortList.size(); i++) {
            IOPort inputPort = (IOPort) inputPortList.get(i);

            if (portSet.contains(inputPort.getName())) {
View Full Code Here


    public void getRefinementReferredInputPorts(State state)
            throws IllegalActionException {
        _refinementReferredInputPorts.clear();

        TypedActor[] refinements = state.getRefinement();
        CompositeActor container = (CompositeActor) getContainer();

        if (refinements != null) {
            for (int i = 0; i < refinements.length; i++) {
                Iterator inputPorts = refinements[i].inputPortList().iterator();
View Full Code Here

                _debug(new FiringEvent(this, actor, FiringEvent.BEFORE_PREFIRE,
                        1));
            }

            if (actor instanceof CompositeActor) {
                CompositeActor compositeActor = (CompositeActor) actor;
                Director insideDirector = compositeActor.getDirector();
                // FIXME: This is bogus.  This is assuming there is no
                // more than one inside director, and is delegating the
                // incrementing of time to that inside director.
                _insideDirector = insideDirector;
                _pseudoTimeEnabled = true;
View Full Code Here

        // an opaque composite actor, then postfire() will not
        // be invoked again to pass this fireAt() request up
        // the hierarchy to the executive director.  We
        // have to pass it up here.
        if (_delegateFireAt) {
            CompositeActor container = (CompositeActor) getContainer();
            if (_debugging) {
                _debug("DEDirector: Requests refiring of: "
                        + container.getName() + " at time " + time);
            }
            // Enqueue a pure event to fire the container of this director.
            container.getExecutiveDirector().fireAt(container, time);
        }
    }
View Full Code Here

        // model time, and hence, if there are also no input events,
        // then there is nothing to do, and we can return false.
        if (!nextEventTime.equals(modelTime)) {
            // If the event timestamp is greater than the model timestamp,
            // we check if there's any external input.
            CompositeActor container = (CompositeActor) getContainer();
            Iterator inputPorts = container.inputPortList().iterator();
            boolean hasInput = false;

            while (inputPorts.hasNext() && !hasInput) {
                IOPort port = (IOPort) inputPorts.next();
View Full Code Here

     *  Update the depths of existing events in the event queue.
     *  @exception IllegalActionException If thrown will getting the depth
     *  of the IO ports or while updating the depth of the the actors.
     */
    protected void _computeActorDepth() throws IllegalActionException {
        CompositeActor container = (CompositeActor) getContainer();
        LinkedList actors = (LinkedList) container.deepEntityList();
        // Add container.
        actors.add(container);
        int numberOfActors = actors.size();
        _actorToDepth = new Hashtable(numberOfActors);

View Full Code Here

        // If the container is not composite actor, there are no actors.
        if (!(container instanceof CompositeActor)) {
            return portsGraph;
        }

        CompositeActor castContainer = (CompositeActor) container;

        // Get the functionDependency attribute of the container of this
        // director. If there is no such attribute, construct one.
        FunctionDependencyOfCompositeActor functionDependency = (FunctionDependencyOfCompositeActor) castContainer
                .getFunctionDependency();

        // NOTE: The following may be a very costly test.
        //       -- from the comments of previous implementations.
        // If the port based data flow graph contains directed
View Full Code Here

     */
    private void _requestFiring() throws IllegalActionException {
        DEEvent nextEvent = null;
        nextEvent = _eventQueue.get();

        CompositeActor container = (CompositeActor) getContainer();

        if (_debugging) {
            _debug("DEDirector: Requests refiring of: " + container.getName()
                    + " at time " + nextEvent.timeStamp());
        }

        // Enqueue a pure event to fire the container of this director.
        container.getExecutiveDirector().fireAt(container,
                nextEvent.timeStamp());
    }
View Full Code Here

     *  is not an instance of this same class.
     *  @return True if it is OK to fire.
     */
    private boolean _prefireWithEnclosingNonContinuousDirector()
            throws IllegalActionException {
        CompositeActor container = (CompositeActor) getContainer();
        Director executiveDirector = ((Actor) container).getExecutiveDirector();

        // Check the enclosing model time against the local model time.
        Time outTime = executiveDirector.getModelTime();
        int comparison = _currentTime.compareTo(outTime);
        if (comparison > 0) {
            // Local current time exceeds that of the environment.
            // We need to roll back. Make sure this is allowable.
            if (!_commitIsPending) {
                throw new IllegalActionException(this, "The model time of "
                        + container.getFullName()
                        + " is greater than the environment time. "
                        + "Environment: " + outTime
                        + ", the model time (iteration begin time): "
                        + _currentTime);
            }
View Full Code Here

     @exception IllegalActionException If the transferInputs(Port)
     *   method throws it.
     */
    private void _transferInputsToInside() throws IllegalActionException {
        // If there are no input ports, this method does nothing.
        CompositeActor container = (CompositeActor) getContainer();
        Iterator inports = container.inputPortList().iterator();
        while (inports.hasNext() && !_stopRequested) {
            IOPort p = (IOPort) inports.next();
            super.transferInputs(p);
        }
    }
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.