SetVariable is deterministic in SDF because it changes parameter
values only in the next iteration of the schedule.

However, this also makes it a highly non-modular design technique.
You may change a seemingly unrelated part of the model and it
will change the behavior of the communication you accomplished
using SetVariable because it will change how many firings of
an actor there are in an iteration.

I agree with your sentiment that it is like a goto...

It is not deterministic in PN or the rendezvous domain...

Edward

At 09:46 AM 4/28/2006, Christopher Brooks wrote:
Jose writes:

>What's the best way to set the value of a Parameter if not with
> SetVariable?

I'm a bit of a purist.  If a value is to change at runtime, I prefer
it to be a port instead of a parameter.  This is especially when using
sdf, I like to see the data flow through ports.  SetVariable works,
but in the distant past, it was a great way to violate determinism.

I view SetVariable the same way I view goto statements or multiple
inheritance.  There are some things that are much easier with
SetVariable, goto or multiple inheritance, but they can cause
problems.

That said, this is just my personal view on SetVariable.  Now, it
seems to not have determinism issues.

When I look at at an actor that has a parameter that I want to
change during a run, I consider rewriting the actor to use a
PortParameter.

Personally, I tend to avoid using Port Parameters between levels of
hierarchy.

Anyway, these are just my views, others will have different way of
working.

_Christopher



--------

    Hi Christopher,


    Thanks for the sugguestions. I'll update my model and give it a try.

    > Also, in some contexts, SetVariable can cause problems with
    > determinism.  I suggest using it carefully.
    >

What's the best way to set the value of a Parameter if not with SetVariable
   ?

    Thanks again, I really appreciate it.

      Jose
--------

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

------------
Edward A. Lee
Professor, Chair of the EE Division, Associate Chair of EECS
231 Cory Hall, UC Berkeley, Berkeley, CA 94720-1770
phone: 510-642-0253 or 510-642-0455, fax: 510-642-2845
[EMAIL PROTECTED], http://ptolemy.eecs.berkeley.edu/~eal

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

Reply via email to