[kepler-dev] modeling question about producing f(A, x), f(A, y)...
Edward A. Lee
eal at eecs.berkeley.edu
Mon Aug 6 06:22:45 PDT 2007
I would use IterateOverArray for this.
It could be less cumbersome, but attached is a model
that does it. Notice that it uses only SDFDirector.
One of our objectives with the higher-order actors (like
IterateOverArray) is to capture such design patterns in easy-to-use
ways. We aren't quite there yet, but the attached isn't too bad...
Edward
At 11:00 AM 8/3/2007, Norbert Podhorszki wrote:
>Hi,
>
>I have no working solution for the following problem described by Bruce Char, see below. Any working idea/example would be appreciated.
>I also have the same problem currently and am craving for a good solution.
>
>Thanks
>Norbert
>
> Norbert Podhorszki
> ------------------------------------
> University of California, Davis
> Department of Computer Science
> 1 Shields Ave, 2236 Kemper Hall
> Davis, CA 95616
> (530) 752-5076
> pnorbert at cs.ucdavis.edu
> ----------------------------------
>
>---------- Forwarded message ----------
>Date: Fri, 03 Aug 2007 13:14:59 -0400
>From: Bruce Char <bchar at cs.drexel.edu>
>
>That seemed to do it. What does this setting do?
>
>I am beginning at least to understand that I don't know how to "solve" certain kinds of situations. Here's the latest:
>
>actor 1 issues a token, call it A. This gets split and sent to multiple branches of the work flow as a trigger.
>One of the branches contains actor 2. This issues one or more tokens (we don't know exactly how many ahead of time). Call them x, y, z, ...
>
>We want to create an actor that is downstream of actors 1 and 2. Its job is to create tokens that are a function of the output of actors 1 and 2: f(A,x), f(A,y), ...
>
>Actor 1 in real life is the job submitter, which produces the location of the working directory, actor 2 is a filter of the file watcher. It's going to create file conversion commands that I'll pass to ssh.
>
>I have realized that I can create actors where all input ports have equal numbers of tokens going in. But in this case I don't have that. If I were in the ordinary programming world I would have actor 1 set a variable v, and lower a sync barrier. actor 2 each time it emits a token would first check that the sync barrier was down and then emit the token. The final actor would refer to the value of v and the input from actor 2 to do its work.
>
>However, I realize I don't really know how to set a variable in Kepler! I know how to set constants (which won't help since the value of A is unknown at
>start up time). I know how to set expressions (which can fire the same number of times as actor 1 fires, which is once). I can imagine that there are some
>kinds of feedback loops that would remember A and then provide it each time a token from actor 2 provides a firing signal. I am not really sure how to set
>the latter up, but needing a feedback loop also seems more complicated than an ordinary user would want. So I figure that there's something in Kepler that can handle this simply but I don't know what it is.
>
>Bruce
>
>----------------------------------------------------------------------------
>Posted to the ptolemy-hackers mailing list. Please send administrative
>mail for this list to: ptolemy-hackers-request at ptolemy.eecs.berkeley.edu
>
------------
Edward A. Lee
Chair of EECS and Robert S. Pepper Distinguished Professor
231 Cory Hall, UC Berkeley, Berkeley, CA 94720-1770
phone: 510-642-0253, fax: 510-642-2845
eal at eecs.Berkeley.EDU, http://ptolemy.eecs.berkeley.edu/~eal
-------------- next part --------------
A non-text attachment was scrubbed...
Name: NorbertsExample.xml
Type: application/xml
Size: 11624 bytes
Desc: not available
URL: <http://mercury.nceas.ucsb.edu/kepler/pipermail/kepler-dev/attachments/20070806/dcd21d70/attachment.rdf>
More information about the Kepler-dev
mailing list