[kepler-users] Adding new parameters

Christopher Brooks cxh at eecs.berkeley.edu
Mon May 24 09:23:14 PDT 2010


Hi Bala,
NamedObj.attributeList() and attributeList(Class filter) will return
all the attributes in an actor.  See
http://ptolemy.eecs.berkeley.edu/ptolemyII/ptII8.0/ptII/doc/codeDoc/ptolemy/kernel/util/NamedObj.html#attributeList%28java.lang.Class%29

Page 8 of Volume 2 of the design doc at
http://ptolemy.eecs.berkeley.edu/ptolemyII/designdoc.htm
says"
"The NamedObj class provides the getAttribute()
method, which takes an attribute name as an argument and returns the attribute, and the
attributeList() method, which returns a list of the attributes contained by the object. Both of these
methods have versions that also takes a Class argument, and returns only attributes that are instances of
the specified Java class."

Parameter is a subclass of Attribute.

One way to distinguish between parameters that are built in to the actor
and parameters that are added later is that parameters that are built in should
have Java fields in the Java class that implements the actor.  These fields
should have the same name as the name of the parameter.  You can use Java
reflection to find Java fields by name.

_Christopher

On 5/23/10 8:40 PM, AMARNATH, Balachandar wrote:
> How do I get list of parameters present in the actor in such a situation
> when two parameters are declared in the code and two are added
> dynamically when the actor is loaded in workflow canvas ?
>
> With thanks and regards
> Bala
>
> -----Original Message-----
> From: kepler-users-bounces at kepler-project.org
> [mailto:kepler-users-bounces at kepler-project.org] On Behalf Of
> Christopher Brooks
> Sent: 23 May 2010 20:58
> To: Jamnagarwala, Arwa Mohmadi
> Cc: kepler-users at kepler-project.org
> Subject: Re: [kepler-users] Adding new parameters
>
> Hi Arwa,
> See
> http://ptolemy.eecs.berkeley.edu/ptolemyII/ptII8.0/ptII/doc/codeDoc/ptol
> emy/kernel/util/NamedObj.html#getAttribute%28java.lang.String,%20java.la
> ng.Class%29
>
> The java would be:
> getAttribute("NewParameter", Parameter.class);
>
> See also the Ptolemy design document,
> http://ptolemy.eecs.berkeley.edu/ptolemyII/designdoc.htm
> Especially chapter 5 "Designing Actors" of Volume 2.
>
> _Christopher
>
> On 5/22/10 1:32 PM, Jamnagarwala, Arwa Mohmadi wrote:
>> Hi All,
>>
>>
>> When we configure an actor we have an option to "Add" a new parameter.
> I was wondering how do we refer to that parameter (which may be added
> later) in the actor's "fire" operation?
>>
>>
>> Thank you!
>> Arwa
>> _______________________________________________
>> Kepler-users mailing list
>> Kepler-users at kepler-project.org
>> http://mercury.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-users
>

-- 
Christopher Brooks, PMP                       University of California
CHESS Executive Director                      US Mail: 337 Cory Hall
Programmer/Analyst CHESS/Ptolemy/Trust        Berkeley, CA 94720-1774
ph: 510.643.9841 fax:510.642.2718	      (Office: 545Q Cory)
home: (F-Tu) 707.665.0131 cell: 707.332.0670



More information about the Kepler-users mailing list