Package ptolemy.actor.util

Examples of ptolemy.actor.util.ConstVariableModelAnalysis


         @return An ArrayType.
         *  @exception IllegalActionException If the type of the
         *  associated typeable cannot be determined.
         */
        public Object getValue() throws IllegalActionException {
            ConstVariableModelAnalysis analysis = ConstVariableModelAnalysis
                    .getAnalysis(symmetricOutput);
            if (analysis.isConstant(symmetricOutput)
                    && analysis.isConstant(numberOfLags)) {
                Token symmetricOutputToken = analysis
                        .getConstantValue(symmetricOutput);
                Token numberOfLagsToken = analysis
                        .getConstantValue(numberOfLags);
                int lags = ((IntToken) numberOfLagsToken).intValue();
                if (((BooleanToken) symmetricOutputToken).booleanValue()) {
                    return _getArrayTypeRaw(2 * lags + 1);
                } else {
View Full Code Here


    /** Declare the rate dependency on any external ports of the model.
     *  SDF directors should invoke this method once during preinitialize.
     */
    public void declareRateDependency() throws IllegalActionException {
        ConstVariableModelAnalysis analysis = ConstVariableModelAnalysis
                .getAnalysis(this);
        SDFDirector director = (SDFDirector) getContainer();
        CompositeActor model = (CompositeActor) director.getContainer();

        for (Iterator ports = model.portList().iterator(); ports.hasNext();) {
View Full Code Here

     *  rate parameters.
     */
    protected void _checkDynamicRateVariables(CompositeActor model,
            List rateVariables) throws IllegalActionException {
        // Check for rate parameters which are dynamic.
        ConstVariableModelAnalysis analysis = ConstVariableModelAnalysis
                .getAnalysis(getContainer());

        // Save the rate variables that we already listen to.
        LinkedList oldList = new LinkedList();
        oldList.addAll(rateVariables);

        LinkedList newList = new LinkedList();
        for (Iterator entities = model.deepEntityList().iterator(); entities
                .hasNext();) {
            Entity entity = (Entity) entities.next();

            for (Iterator ports = entity.portList().iterator(); ports.hasNext();) {
                Port port = (Port) ports.next();
                Set set = analysis.getNotConstVariables(port);
                Variable variable;
                variable = DFUtilities.getRateVariable(port,
                        "tokenInitProduction");
                _listenToRateVariable(variable, rateVariables);
                newList.add(variable);
View Full Code Here

        // controller makes a state transition, unless the
        // corresponding refinement rate parameters are constant,
        // and have the same value.  (Note that the controller
        // itself makes transitions less often if its executive director
        // is an HDFFSMDirector, which is a subclass of MultirateFSMDirector.
        ConstVariableModelAnalysis analysis = ConstVariableModelAnalysis
                .getAnalysis(this);
        CompositeActor model = (CompositeActor) getContainer();

        for (Iterator ports = model.portList().iterator(); ports.hasNext();) {
            IOPort port = (IOPort) ports.next();
View Full Code Here

        Map attributeToValueFieldMap = new HashMap();

        boolean debug = PhaseOptions.getBoolean(options, "debug");
        // Determine which parameters have a constant value.
        ConstVariableModelAnalysis constantAnalysis;

        try {
            constantAnalysis = new ConstVariableModelAnalysis(_model);
        } catch (KernelException ex) {
            throw new RuntimeException(ex.getMessage());
        }

        // For every variable and settable attribute in the model, create a
View Full Code Here

        _entityLocalMap = new HashMap();
        _portLocalMap = new HashMap();

        try {
            _constAnalysis = new ConstVariableModelAnalysis(_model);
        } catch (Exception ex) {
            throw new RuntimeException("Failed to calculate constant vars: "
                    + ex.getMessage());
        }
View Full Code Here

         * @return An ArrayType.
         * @exception IllegalActionException If the type of the
         * associated typeable cannot be determined.
         */
        public Object getValue() throws IllegalActionException  {
            ConstVariableModelAnalysis analysis = ConstVariableModelAnalysis.getAnalysis(symmetricOutput);
            if (analysis.isConstant(symmetricOutput) && analysis.isConstant(numberOfLags)) {
                Token symmetricOutputToken = analysis.getConstantValue(symmetricOutput);
                Token numberOfLagsToken = analysis.getConstantValue(numberOfLags);
                int lags = ((IntToken)numberOfLagsToken).intValue();
                if (((BooleanToken)symmetricOutputToken).booleanValue()) {
                    return _getArrayTypeRaw(2 * lags + 1);
                } else {
                    return _getArrayTypeRaw(2 * lags);
 
View Full Code Here

TOP

Related Classes of ptolemy.actor.util.ConstVariableModelAnalysis

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.