[kepler-users] About actor parameters

Christopher Brooks cxh at eecs.berkeley.edu
Fri May 14 12:14:39 PDT 2010


Hi Arwa,
If the parameter is a defined in an actor that is defined by a Java
class or in an actor that is defined by MoML that defines an Actor-Oriented Class (AOC),
then yes, you cannot remove the parameter.

In the first case, the parameter is a variable in a Java class.  In most
object-oriented systems, one cannot remove variables from parent classes.
There probably are OO systems out there that allow removal, but Java is
not one of them.  Java allows a subclass to have a variable with the same name and type
as a variable in the parent class, but this is usually considered poor form.

Actor-Oriented classes follow the same design.

BTW - Edward's paper "Classes and inheritance in actor-oriented design"
was finally published in ACM Transactions on Embedded Computing Systems (TECS)
http://doi.acm.org/10.1145/1550987.1550992
A preprint is at:
http://chess.eecs.berkeley.edu/pubs/429.html

If the parameter is defined in a composite actor that is not an actor-oriented class
definition or a composite actor that is an instance of an actor-oriented class and
the parameter is not in the AOC definition, then you should be able to remove the parameter.

Another trick would be to have the definition of your class in the left hand actor pane
define the parameter in MoML.  Then, when you drag in the parameter, you will get the parameter.

For example, kepler/ptolemy/src/ptolemy/actor/lib/genericsources.xml
has the following definition for Const:

<entity name="Const" class="ptolemy.actor.lib.Const">
<doc>Create a constant sequence.</doc>
    <property name="_icon" class="ptolemy.vergil.icon.BoxedValueIcon">
       <property name="attributeName" value="value"/>
       <property name="displayWidth" value="60"/>
    </property>
</entity>

When you drag a Const in, the _icon parameter is set.
The _icon parameter is not defined in Const.java.
I believe that you could remove the _icon parameter with MoMLChangeRequest.

_Christopher

On 5/13/10 8:49 PM, Jamnagarwala, Arwa Mohmadi wrote:
> Hi all,
>
> I have a follow up question.
> We are trying to delete an actor's  parameter using MOMLChangeRequest and trying to add a new parameter with the same name.
> However when I do this I get an error saying the property is part of class definition and cannot be deleted. Since this fails, I cannot add a new parameter with the same name.
> Am I missing something here?
>
> Thanks,
> Arwa
>
>
> ________________________________________
> From: kepler-users-bounces at kepler-project.org [kepler-users-bounces at kepler-project.org] On Behalf Of Jamnagarwala, Arwa Mohmadi [aj1171 at txstate.edu]
> Sent: Monday, May 03, 2010 1:40 PM
> To: kepler-users at kepler-project.org
> Subject: [kepler-users] About actor parameters
>
> Hi,
>
> I have two questions:
>
> 1) Is there any function in the Ptolemy api using which I can retrieve the set of parameters associated with an actor? (just as we can get the list of ports)
>
> 2) In uiContextMenuMappings_en_US.xml file some entries have keys mapped to Ptolemy menu locations, for instance:
>
> <pair>
>      <name>ACTOR->Configure Actor</name>
>      <value>ACTOR->Customize->Configure</value>
>   </pair>
>
>
> Where can I find the source code associated with the "configure actor" choice?
>
> Thanks,
> Arwa
>
>
>
>
> _______________________________________________
> Kepler-users mailing list
> Kepler-users at kepler-project.org
> http://mercury.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-users
> _______________________________________________
> 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