[kepler-users] receiving tokens on different ports

Edward A. Lee eal at eecs.berkeley.edu
Fri Aug 14 10:20:55 PDT 2009


PN has "blocking read" semantics. Here is a paper on why this is:

http://ptolemy.eecs.berkeley.edu/publications/papers/95/processNets/

A consequence is that in PN, there is no such thing as a port
that has no input token available.

There are two ways to accomplish what you want:

1) Build an actor in extended PN that is nondeterminate.
    The NondeterminateMerge actor can serve as a model.

2) Use multiple actors. This seems like the right solution.
    Why do you want this in one actor?  Anything the actors
    post to the GUI has to be done in the event thread anyway,
    so there is no real advantage to having them in separate
    threads...

Edward


Chris Weed wrote:
> I am creating a custom display that receives different data types on
> different ports,
> image URL on one, GML data on another, etc.
> When my actor fires, any one of these ports could have new data.
> How do I figure out which one when I am using the PN director?
> Normally, I would just loop through all of the ports, but
> won't the port always return true for hasToken and then block when I call
> port.get()?
> I am confused how this should work.
> Chris
> _______________________________________________
> Kepler-users mailing list
> Kepler-users at kepler-project.org
> http://mercury.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-users
-------------- next part --------------
A non-text attachment was scrubbed...
Name: eal.vcf
Type: text/x-vcard
Size: 351 bytes
Desc: not available
URL: <http://lists.nceas.ucsb.edu/kepler/pipermail/kepler-users/attachments/20090814/2644e02d/attachment.vcf>


More information about the Kepler-users mailing list