[kepler-dev] Ports

Ivens ivensportugal at gmail.com
Fri Jul 30 06:00:36 PDT 2010


Hi ilkay,

yes i can add the actor do Display, and it works well.
But Display Actor has a port from General Type and accepts every type of
Token.

The problem is... my actor must send the Token he received... but i dont
know the type of that Token.

For instance:
suppose i have (SDF Director) a String Constant --- myActor --- String to
Int --- Display

my actor must get a String from String Constant (which is easy using an
input Port from GENERAL type) and send this String Token through a STRING
type Port, because String to Int must receive a StringToken.

But..
Suppose (SDF Director)   Const --- myActor --- AddOrSubtract --- Display

my actor must get a Integer and send it through a INTEGER type Port, because
AddOrSubtract expects that.

In other words, the output Port may be generic...
but if i declare it as GENERAL, it won't work

and i cannot use output.setTypeAtLeast(input), because my input port is
GENERAL.

did you understand?

On Wed, Jul 28, 2010 at 4:42 PM, Ilkay Altintas <altintas at sdsc.edu> wrote:

> Hi,
>
> The general data type is the most inclusive of the types.  Can you link
> your actor to display?
>
> There's some more information on the type system conversions in the ptolemy
> documentation  (section 4.5.4: Conversions) at:
> http://www.eecs.berkeley.edu/Pubs/TechRpts/2008/EECS-2008-28.html
>
> -ilkay
>
>
> --
> Ilkay ALTINTAS
> Deputy Coordinator for Research, San Diego Supercomputer Center (SDSC)
> Lab Director, Scientific Workflow Automation Technologies (SWAT @ SDSC)
>
> University of California, San Diego
> 9500 Gilman Drive, MC: 0505  La Jolla, CA  92093-0505
> Phone: (858) 210-5877                     Fax: (858) 534-8303
> Web: http://users.sdsc.edu/~altintas
> Skype: ilkay.altintas
>
>
>
>
>
>
>
>
> On Jul 28, 2010, at 10:32 AM, Ivens wrote:
>
>  Hi,
>>
>> I wrote an Actor in Java that has 2 ports: one is input and the other one
>> is output.
>> Both are from GENERAL type. (deal with GENERAL tokens)
>>
>> The output port sends the same data the input port receives.
>> And then, i connect the output port to any other Kepler Actor (for
>> instance, String to Int.string)
>>
>> When i click 'play' to start the execution, i get an error message.
>> i think that is because my output port is from GENERAL type... and it is
>> connected to a port from STRING type
>>
>> So, i changed that type to UNKNOWN... but the error persists...
>> Can you help me?
>>
>> Thanks
>> _______________________________________________
>> Kepler-dev mailing list
>> Kepler-dev at kepler-project.org
>> http://mercury.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-dev
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercury.nceas.ucsb.edu/kepler/pipermail/kepler-dev/attachments/20100730/ee1c553e/attachment.html>


More information about the Kepler-dev mailing list