[kepler-dev] Reg. IF_THEN_ELSE loop

Norbert Podhorszki pnorbert at cs.ucdavis.edu
Tue Mar 28 12:44:31 PST 2006


Hi Sivagowri,

Just replace the two String Constant actors with Constant actors, and it 
will work (set the value within ""). The String Constant actor fires 
only once, not indefinitely as the Constant actor.
Norbert

On Tue, 28 Mar 2006, Sivagowri Swaminathan wrote:

> you are right. Here is the workflow I have created. Any help regarding this 
> is welcome.
>
> Thanx
> siva
> enclosed>> mux.xml
>
>> From: "Edward A. Lee" <eal at eecs.berkeley.edu>
>> To: "Sivagowri Swaminathan" <sivagowri at hotmail.com>
>> CC: Kepler-dev at ecoinformatics.org
>> Subject: Re: [kepler-dev] Reg. IF_THEN_ELSE loop
>> Date: Tue, 28 Mar 2006 09:08:40 -0800
>> 
>> 
>> Instead of describing the model in words, how about sending it as
>> an attachment?  This would make it much easier to understand :-)
>> 
>> Edward
>> 
>> At 09:48 PM 3/27/2006, Sivagowri Swaminathan wrote:
>>> Hi Edward and Dan
>>> 
>>> Thanks for your suggestions. Using Edwards suggestion, I used a boolean 
>>> switch [boolean mux also worked] to direct the tokens onto two different 
>>> paths.
>>> This is my construction:
>>> 1. I used a ramp for incrementing from 1 .
>>> 2. A constant value = 3 was compared to the ramp value using boolean 
>>> equals actor.
>>> 3. The output from the equals actor was directed to a boolean mux, which 
>>> had 2 string constants
>>> 'true output' and 'false output' as inputs to the mux.
>>> 4. The output of the mux is connected to a text display.
>>> 
>>> 5. as per Dan's suggestion, I used a PN director. [Initially I used a sdf 
>>> director.]
>>> 
>>> since 1 != 3, the output of mux showed 'false output' on the display and 
>>> it stopped.
>>> But the ramp was not incremented at all. I expected a series of false, 
>>> false, true, false ... in the display but I received only one output.
>>> 
>>> If I used an SDF director set to 20 iterations, I get the first output 
>>> only. If I used a PN director, I get an error message stating that the 
>>> queue size exceeded the maximum limit.
>>> 
>>> questions
>>> 
>>> 1. I want the output as when the ramp gets incremented, what director I 
>>> should use?
>>> 2. How do I get documentation for the actors? the right-click, get 
>>> Documentation doesn't work and errors out saying I need to get the 
>>> document component. Where to get this component from?
>>> 
>>> alternatively, I used 'openActor' to see the source code and inferred what 
>>> the actor tries to do. It helped me a lot to understand the actor.
>>> 
>>> Thanx
>>> Siva
>>> 
>>> 
>>>> From: "Edward A. Lee" <eal at eecs.berkeley.edu>
>>>> To: "Sivagowri Swaminathan" <sivagowri at hotmail.com>
>>>> CC: Kepler-dev at ecoinformatics.org
>>>> Subject: Re: [kepler-dev] Reg. IF_THEN_ELSE loop
>>>> Date: Mon, 27 Mar 2006 09:04:26 -0800
>>>> 
>>>> 
>>>> The BooleanToAnything actor can convert true/false into two
>>>> distinct strings.
>>>> 
>>>> Alternatively, you can control a BooleanSwitch actor and route
>>>> tokens to one of two subsystems.
>>>> 
>>>> A third alternative is to use the newly added Case actor,
>>>> in actor/hoc in the Ptolemy II default configuration...
>>>> I'm not sure whether this is visible in the Kepler library...
>>>> 
>>>> Edward
>>>> 
>>>> At 06:07 PM 3/26/2006, Sivagowri Swaminathan wrote:
>>>>> Hi all
>>>>> 
>>>>> I have a problem implementing an if-then-else kind of workflow and would
>>>>> like to get help regarding the same.
>>>>> 
>>>>> I want to implement a logic such as this:
>>>>> 
>>>>> if some constant's value = x, then I need to display some message else I
>>>>> need to display some other msg.
>>>>> 
>>>>> The comparator and the booleans equals actor(operator) actually outputs
>>>>> results such as true/false. how do I create an action based on the 
>>>>> output
>>>>> from the actors?
>>>>> 
>>>>> I running behind on a deadline and would like to get help on this asap.
>>>>> 
>>>>> Thanx
>>>>> Siva
>>>>> 
>>>>> 
>>>>> _______________________________________________
>>>>> Kepler-dev mailing list
>>>>> Kepler-dev at ecoinformatics.org
>>>>> http://mercury.nceas.ucsb.edu/ecoinformatics/mailman/listinfo/kepler-dev
>>>> 
>>>> ------------
>>>> 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
>> 
>
>

-- 

      Norbert Podhorszki
    ------------------------------------
      University of California, Davis
      Department of Computer Science
      1 Shields Ave, 2236 Kemper Hall
      Davis, CA 95616
      (530) 754-8188
      pnorbert at cs.ucdavis.edu
      ----------------------------------


More information about the Kepler-dev mailing list