[kepler-dev] [kepler-users] Add port to an actor
Edward A. Lee
eal at eecs.berkeley.edu
Mon Apr 3 14:38:13 PDT 2006
Oh, I see... I misunderstood...
An actor can throw an exception when a port is added,
but it would have to be carefully written to do so after its own
constructor (and that of subclasses) has completed. It turns
that this is difficult to do in Java (the constructors of base
classes get invoked first, and the base class is not notified in
any way when the constructors of subclasses have completed).
At 12:06 PM 4/3/2006, Ilkay Altintas wrote:
>My question was as a follow-up to Dan's comment. Our users get confused by
>the fact that they can add new ports to any actor but most of the time
>this port cannot be used by the actor. So I was asking how we can disable
>the functionality to add new ports when the actor doesn't use it.
>On Mon, April 3, 2006 11:57 am, Edward A. Lee wrote:
> > At 11:16 AM 4/3/2006, Ilkay Altintas wrote:
> >>On Mon, April 3, 2006 9:44 am, Dan Higgins wrote:
> >> > Unfortunately, you can add ports to any actor although in most
> >> cases
> >> > the added port has no function since the actor code never looks for
> >> it.
> >> > This has caused confusion for several new Kepler users.
> >> >
> >>This sounds like a problem. I wonder if we can disable that functionality
> >>when it is not needed through global parameter or so... The actor can
> >>enable it when it uses that feature.
> >>Matthew, Edward: Any ideas?
> > It is easy to write actors that react to new ports when the are
> > added. For example, RecordAssembler works this way... I you don't
> > add ports, it has no useful function. Same for Expression.
> > Also, note that any composite actor has user-added ports.
> > However, a general mechanism that works for all actors makes
> > no sense. What should the actor do with data on the new port?
> > If you are suggesting that one should be able to add arbitrary
> > functionality to an actor without writing Java code, then I suggest
> > you use the Matlab or Python actors. This is exactly what they
> > enable... But any such actor will have to provide a programming
> > language so you can specify what the actor should do with new data.
> > You can think of composite actors, in fact, as being exactly this,
> > but where the "programming language" for specifying functionality
> > is Ptolemy II.
> > Edward
> > ------------
> > Edward A. Lee
> > Professor, Chair of the EE Division, Associate Chair of EECS
> > 231 Cory Hall, UC Berkeley, Berkeley, CA 94720
> > phone: 510-642-0253 or 510-642-0455, fax: 510-642-2845
> > eal at eecs.Berkeley.EDU, http://ptolemy.eecs.berkeley.edu/~eal
Edward A. Lee
Professor, Chair of the EE Division, Associate Chair of EECS
231 Cory Hall, UC Berkeley, Berkeley, CA 94720
phone: 510-642-0253 or 510-642-0455, fax: 510-642-2845
eal at eecs.Berkeley.EDU, http://ptolemy.eecs.berkeley.edu/~eal
More information about the Kepler-dev