[kepler-dev] PortParameters Bug?

Stephen Andrew Neuendorffer neuendor at eecs.berkeley.edu
Mon Jul 12 18:08:22 PDT 2004


>
>  2) Certain actors (such as the Integrator in CT) read parameter values only
>     during initialization.  During initialization, a PortParameter can only
>     have a value set via the parameter (it can't have yet received a token).
>     So if the initial value of the Integrator is set to the value of the
>     PortParameter, then it will see only the parameter value, never the value
>     provided via the port.
>
>     Workaround: Use a RunCompositeActor to contain the model with the
>     Integrator.

This is a case where reconfiguration type constraints should be required by 
the Integrator.
putting code like the following in preinitialize:

         ConstVariableModelAnalysis analysis =
             ConstVariableModelAnalysis.getAnalysis(this);
         if(analysis.isConstant(variable)) {
             throw new IllegalActionException(variable,
                     "The parameter cannot be reconfigured during execution 
of the model.");
         }

Alternatively (and perhaps preferably), the fact that the parameter cannot 
be meaningfully reconfigured
could be declared and checked automatically.

I'm beginning to think there is an interesting connection between 
reconfiguration constraints
like the above and lifecycle models.  In particular, it should be valid to 
reset the state of the
integrator as long as it is done in a reset transition.  In general, 
reconfiguration can always be performed
between executions of lifecycle actors like RunCompositeActor, since the 
executions are
completely independent.

Steve




More information about the Kepler-dev mailing list