[kepler-dev] Parameter and Actor names in Kepler's expression language

Dan Higgins higgins at nceas.ucsb.edu
Thu Sep 21 14:07:38 PDT 2006


One issue discussed at the recent Kepler documentation meeting in Coos 
Bay was the questions of spaces in actor and parameter names. (We would 
like to use spaces in documentation for clarity, but the question of 
whether spaces can be used in the expression language came up.)

In section 2.5.1 (p 62) of Volume1 of the Ptolemy II manual it says

"Right click on the parameter to change its name to “noisePower”. (In 
order to be
able to use this parameter in expressions, the name cannot have any 
spaces in it.)"

so spaces can be used in Parameter names, but if used, the parameter 
cannot be used in the expression language!

In most cases, it appears that actor names are not used in the 
expression language, so that the use of spaces should make little 
difference, since parameters are referenced by scope rather than actor 
name i.e.

"The variables in the expression refer to other parameters that are in 
scope, which are those contained by the same container or some container 
above in the hierarchy." (p 98 of PTII Design, Vol1)

There is an exception to this (p 96) where a container is referenced by name
"Occasionally, it is desirable to access parameters that are not in 
scope. The expression language
supports a limited syntax that permits access to certain variables out 
of scope. In particular, if in place of a variable name x in an 
expression you write A::x, then instead of looking for x in scope, the 
interpreter looks for a container named A in the scope and a parameter 
named x in A. This allows reaching down one level in the hierarchy from 
either the current container or any of its containers."

---
Parameters created in Java classes can have a '_displayName' because 
there is a 'setDisplayName' method in the NamedObj class that saves the 
_displayName for any object that extends NamedObj. However, looking at 
the MOMLindicates that the _displayName is NOT saved in the MOML. This 
would seem to indicate that parameters inside composites cannot be given 
a display name that is separate from their primary name.


-- 
*******************************************************************
Dan Higgins                                  higgins at nceas.ucsb.edu
http://www.nceas.ucsb.edu/    Ph: 805-893-5127
National Center for Ecological Analysis and Synthesis (NCEAS) Marine Science Building - Room 3405
Santa Barbara, CA 93195
*******************************************************************




More information about the Kepler-dev mailing list