Re: [Ptolemy] [Info] needed regarding execution under SDF model

2004-06-02 Thread Stephen Andrew Neuendorffer
It sounds like what you want is to put a downsampler between HT1 and HT2 with
a rate of N1.   With the correct setting of the phase parameter, the 
downsampler
will discard all but the last token out of N1.  This token will be passed 
to HT2.
similar for the connection between HT2 and HT3.  With the token rates of 
each port of
HT1, 2, 3 set to one, you will get the dataflow you want.   Setting the 
iterationCount parameter
of the SDF director to 1 will cause the model to stop executing after HT3 
executes once.

Unfortunately, it means that each firing HT1 produces an dummy value.  To be a
technically valid SDF model it must...  From the point of view of the 
interface of HT1 alone,
I'm a bit at a loss as to why it must execute N1 times?  In seems to me 
like the
N1 firings of HT1 and the N2 firings of HT2 could be hidden inside the 
actor, but without
more information about where the desired number of firings is coming from, 
I couldn't
hazard a guess as to the right way to represent it.

Steve

From: John Doe <[EMAIL PROTECTED]>
Subject: Help needed regarding execution under SDF model
Date: Tue, 01 Jun 2004 18:07:31 +0200
Hello, I need some help to be able to simulate a new langage in ptolemy.
I have a graph with several hierchical tasks (HT) : HT1 --- HT2 --- HT3
- ---
I need to execute HT1 N1 times before producing one result, this result is
consumed by HT2. I don't need to execute HT1 anymore.
After i need to execute HT2 N2 times before producing one result this
result is consumed by HT3. And i don't need to execute HT2 anymore.
and so on ...
N1 is different from N2, N2 from N3 ...
Is there a way to do it properly using an SDF director or any other
directors ?
Thanking you in advance
Philippe
--- End of Forwarded Message
___
Ptolemy maillist  -  [EMAIL PROTECTED]
http://chess.eecs.berkeley.edu/ptolemy/listinfo/ptolemy


Posted to the ptolemy-hackers mailing list.  Please send administrative
mail for this list to: [EMAIL PROTECTED]


Re: [Ptolemy] [Info] needed regarding execution under SDF model

2004-06-03 Thread Philippe.Dumont
 Stephen Andrew Neuendorffer wrote:
I'm a bit at a loss as to why it must execute N1 times?  In seems to me
like the N1 firings of HT1 and the N2 firings of HT2 could be hidden inside the
actor, but without more information about where the desired number of firings is coming
from, I couldn't hazard a guess as to the right way to represent it.
"The N1 firings of HT1 and the N2 firings of HT2 could be hidden inside"
I do agree with you, but I don't know how to proceed...
In fact in our model, there are two levels :
The first is the one I described in my last mail.
Each HT (Hierarchical Task), contains the second level :
When I take an input token, I cut it in N parts, I do a computation on
each part. At the end I take the N results of the computation
and I produce the result token.
So I use N "firings" to do the N computations. I don't have the choice
because I need to increment a counter in the  firing method of the director.
The director is an SDF director.
I try to use the "iterate" method but i don't know how to use it properly.
I can't use the  "preinitialize" or "initialize" method because all the 
methods "preinitialize" or "initialize" of all the HT must be executed 
before a fire.
I would like to call it between "initialize" and "prefire". I think it's 
the best solution. But I do not know if it is possible ?

Philippe


Posted to the ptolemy-hackers mailing list.  Please send administrative
mail for this list to: [EMAIL PROTECTED]


Re: [Ptolemy] [Info] needed regarding execution under SDF model

2004-06-03 Thread Stephen Andrew Neuendorffer
At 05:53 AM 6/3/2004, Philippe.Dumont wrote:
 Stephen Andrew Neuendorffer wrote:
I'm a bit at a loss as to why it must execute N1 times?  In seems to me
like the N1 firings of HT1 and the N2 firings of HT2 could be hidden 
inside the
actor, but without more information about where the desired number of 
firings is coming
from, I couldn't hazard a guess as to the right way to represent it.
"The N1 firings of HT1 and the N2 firings of HT2 could be hidden inside"
I do agree with you, but I don't know how to proceed...
In fact in our model, there are two levels :
The first is the one I described in my last mail.
Each HT (Hierarchical Task), contains the second level :
When I take an input token, I cut it in N parts, I do a computation on
each part. At the end I take the N results of the computation
and I produce the result token. So I use N "firings" to do the N 
computations. I don't have the choice
because I need to increment a counter in the  firing method of the director.
OK, so I see two ways to approach this:
1) represent the extraction and composition of the N parts explicitly.
2) have it happen implicitly.
I'm not sure what you are interested in:
1) is pretty straightforward (use an ArrayToSequence to
extract the N tokens, send them through an actor, and then use a 
Downsampler to
discard all but the last output)

2) I could picture doing a couple of ways, depending on how you are 
representing the primitive operation
and what is important about it.  The Director.transferInputs and 
transferOutputs methods could be overridden
to do what you want to do.  The primary downside to this is that you end up 
with an extra layer of hieararchy.
The IterateOverArray actor (actor.lib.hoc) implements one way of hiding the 
extra hierarchy in the user interface.
It overrides the director to behave as a "ArrayToSequence", followed by an 
actor, followed by "SequenceToArray"
It sounds like you want something similar, but with a DownSampler instead 
of a SequenceToArray.


The director is an SDF director.
I try to use the "iterate" method but i don't know how to use it properly.
I can't use the  "preinitialize" or "initialize" method because all the 
methods "preinitialize" or "initialize" of all the HT must be executed 
before a fire.
I would like to call it between "initialize" and "prefire". I think it's 
the best solution. But I do not know if it is possible ?
I don't understand what you are trying to do here...
Steve


Posted to the ptolemy-hackers mailing list.  Please send administrative
mail for this list to: [EMAIL PROTECTED]