[kepler-users] retrieving name of a container at run time.

Bob Weber rweber221 at gmail.com
Fri Feb 11 11:25:49 PST 2011


I have discovered that setting the value of a constant actor to the
expression getContainer().getName will retrieve the name of the next level
up container. But, the constant actor only evaluates the expression when the
expression changes, not when the constant fires. Therefore, if the name of
the container changes, the old name will be output by the constant, not the
new name.

I know that Ptolemy offers a Name Parameter that does the reverse of what I
want--it sets the name of the container. But then the container cannot be
easily re-instantiated or copy-pasted because the new instance gets the name
set by the Name Parameter (which doesn't seem to check for, or gracefully,
handle name collisions).

I have tried to use the getContainer().getName in an Expression actor and in
a Python actor to get the expression to be evaluated at run time but neither
of those actors recognizes the function.

I understand that I could create a constant equal to the string I'm trying
to retrieve but I was hoping to use the rename command accessed by right
clicking on the container to provide a smoother, more consistent user
interface.

So, is there a way to programmatically retrieve the name of an actor's
container?

Thanks,
Bob Weber
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nceas.ucsb.edu/kepler/pipermail/kepler-users/attachments/20110211/76d4484a/attachment.html>


More information about the Kepler-users mailing list