Package ptolemy.kernel

Examples of ptolemy.kernel.Entity$ContainedObjectsIterator


            // Mirror the change in mirror ports.
            MultiCompositeActor container = (MultiCompositeActor) getContainer();
            Iterator entities = container.entityList().iterator();

            while (entities.hasNext()) {
                Entity entity = (Entity) entities.next();
                Port mirrorPort = entity.getPort(getName());

                if (mirrorPort instanceof RefinementPort) {
                    RefinementPort castPort = (RefinementPort) mirrorPort;
                    boolean disableStatus = castPort._mirrorDisable;
View Full Code Here


            // Mirror the change in mirror ports.
            MultiCompositeActor container = (MultiCompositeActor) getContainer();
            Iterator entities = container.entityList().iterator();

            while (entities.hasNext()) {
                Entity entity = (Entity) entities.next();
                Port mirrorPort = entity.getPort(getName());

                if (mirrorPort instanceof RefinementPort) {
                    RefinementPort castPort = (RefinementPort) mirrorPort;
                    boolean disableStatus = castPort._mirrorDisable;
View Full Code Here

            // to originally set the name.
            if (container != null) {
                Iterator entities = container.entityList().iterator();

                while (entities.hasNext()) {
                    Entity entity = (Entity) entities.next();
                    Port mirrorPort = entity.getPort(oldName);

                    if (mirrorPort instanceof RefinementPort) {
                        RefinementPort castPort = (RefinementPort) mirrorPort;
                        boolean disableStatus = castPort._mirrorDisable;
View Full Code Here

            // Mirror the change in mirror ports.
            MultiCompositeActor container = (MultiCompositeActor) getContainer();
            Iterator entities = container.entityList().iterator();

            while (entities.hasNext()) {
                Entity entity = (Entity) entities.next();
                Port mirrorPort = entity.getPort(getName());

                if (mirrorPort instanceof RefinementPort) {
                    RefinementPort castPort = (RefinementPort) mirrorPort;
                    boolean disableStatus = castPort._mirrorDisable;

                    try {
                        castPort._mirrorDisable = true;
                        castPort.setOutput(isOutput);
                    } finally {
                        castPort._mirrorDisable = disableStatus;
                    }

                    // If the entity is a controller, then set the
                    // port to also be an input.
                    if (entity.getName().equals("_Controller")) {
                        boolean controlPortStatus = castPort._mirrorDisable;

                        try {
                            castPort._mirrorDisable = true;
                            castPort.setInput(true);
View Full Code Here

    }

    // Initialize which columns will be visible for this target.
    private void _initColumnNames() {
        // Get the Entity for which we are configuring the ports.
        Entity target = getTarget();

        // Set up the column names that will be visible.
        String[] tempColumnNames = null;

        if (target instanceof TypedActor) {
View Full Code Here

        /*SootMethod setTokenMethod = */parameterClass
                .getMethod("void setToken(ptolemy.data.Token)");

        // Loop over all the actor instance classes.
        for (Iterator i = _model.deepEntityList().iterator(); i.hasNext();) {
            Entity entity = (Entity) i.next();
            String className = PhaseOptions.getString(options, "targetPackage")
                    + "." + entity.getName();
            SootClass entityClass = Scene.v().loadClassAndSupport(className);

            for (Iterator fields = entityClass.getFields().iterator(); fields
                    .hasNext();) {
                SootField field = (SootField) fields.next();
View Full Code Here

        CompositeEntity container = (CompositeEntity) getContainer();

        if (container != null) {
            for (Iterator entities = container.deepEntityList().iterator(); entities
                    .hasNext();) {
                Entity actor = (Entity) entities.next();
                Variable parameter = (Variable) actor
                        .getAttribute("firingCount");

                if (parameter != null) {
                    parameter.setExpression("0");
                }
View Full Code Here

            } else if (port.isInput()) {
                List sinks = port.insideSinkPortList();

                if (sinks.size() > 0) {
                    IOPort connectedPort = (IOPort) sinks.get(0);
                    Entity entity = (Entity) connectedPort.getContainer();
                    String name = connectedPort.getName(model);
                    String identifier = name.replaceAll("\\.", "::");

                    String sinkExpression;
                    Variable sinkRateVariable = DFUtilities.getRateVariable(
                            connectedPort, "tokenConsumptionRate");

                    if (sinkRateVariable == null) {
                        sinkExpression = "1";
                    } else {
                        sinkExpression = identifier + "::"
                                + sinkRateVariable.getName();
                    }

                    String expression = sinkExpression + " * "
                            + entity.getName() + "::firingsPerIteration";

                    DFUtilities.setExpressionIfNotDefined(port,
                            "tokenConsumptionRate", expression);

                    if (_debugging && VERBOSE) {
                        _debug("Setting tokenConsumptionRate to " + expression);
                    }
                }
            } else if (port.isOutput()) {
                List sources = port.insideSourcePortList();

                if (sources.size() > 0) {
                    IOPort connectedPort = (IOPort) sources.get(0);
                    Entity entity = (Entity) connectedPort.getContainer();
                    String name = connectedPort.getName(model);
                    String identifier = name.replaceAll("\\.", "::");
                    Variable sourceRateVariable = DFUtilities.getRateVariable(
                            connectedPort, "tokenProductionRate");
                    String sourceExpression;

                    if (sourceRateVariable == null) {
                        sourceExpression = "1";
                    } else {
                        sourceExpression = identifier + "::"
                                + sourceRateVariable.getName();
                    }

                    String expression = sourceExpression + " * "
                            + entity.getName() + "::firingsPerIteration";

                    DFUtilities.setExpressionIfNotDefined(port,
                            "tokenProductionRate", expression);

                    if (_debugging && VERBOSE) {
View Full Code Here

            recursiveExpression = expression + "*" + element.expression();
        }

        if (element instanceof SymbolicFiring) {
            SymbolicFiring firing = (SymbolicFiring) element;
            Entity actor = (Entity) firing.getActor();
            Variable parameter = (Variable) actor
                    .getAttribute("firingsPerIteration");

            if (parameter == null) {
                parameter = new Parameter(actor, "firingsPerIteration");
                parameter.setVisibility(Settable.NOT_EDITABLE);
View Full Code Here

        _isOff = Boolean.TRUE;

        // Get the channel specified by the channelName parameter.
        CompositeEntity container = (CompositeEntity) getContainer();
        Entity channel = container.getEntity(channelName.stringValue());

        if (channel instanceof WirelessChannel) {
            _channel = (WirelessChannel) channel;
            ((WirelessChannel) channel).addChannelListener(this);
        } else {
View Full Code Here

TOP

Related Classes of ptolemy.kernel.Entity$ContainedObjectsIterator

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.