<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi Ric,</div><div><br></div><div>I found some relevant info here;</div><div><a href="http://ptolemy.eecs.berkeley.edu/ptolemyII/ptIIfaq.htm#Interfacing%20to%20C/C++">http://ptolemy.eecs.berkeley.edu/ptolemyII/ptIIfaq.htm#Interfacing to C/C++</a></div><div><a href="http://ptolemy.eecs.berkeley.edu/ptolemyII/ptIIfaq.htm#CodeGen">http://ptolemy.eecs.berkeley.edu/ptolemyII/ptIIfaq.htm#CodeGen</a></div><div>The descriptions make it sound like these aren't being worked on anymore, but I've seen ptolemy SVN check-ins that seem to do w/ C code generation and copernicus in the recent past, so I'm not sure about that.</div><div><br></div><div>Note you can call any arbitrary program using the External Execution actor.</div><div><br></div><div>If you're trying to develop new actor(s), customizing the RExpression or Python actors, or writing new ones in Java is probably easiest.</div><div>Derik</div><div><div><div><br></div><div>On Oct 1, 2012, at 8:46 AM, "Edward A. Lee" <<a href="mailto:eal@eecs.berkeley.edu">eal@eecs.berkeley.edu</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><br>The SetVariable actor is rather tricky to use.<br>Depending on the director that you choose and the parameters you set,<br>it could be nondeterministic.  Why go through a variable? Why not just<br>feed the data from DirectoryListing to where it is needed?<br><br>If there are lots of places it is needed, you might consider using<br>Publisher and Subscriber.  These, at least, are assured of determinism.<br><br>It is a bit of a change of mindset to "think in kepler" :-)<br>It's quite important which director you pick. They all provide<br>a concurrent model of computation, but their behaviors are quite<br>different...<br><br>Edward<br><br><br>On 9/30/12 8:49 PM, <a href="mailto:Ricardo.Pascual@csiro.au">Ricardo.Pascual@csiro.au</a> wrote:<br><blockquote type="cite">Hi Edward.<br><br>Thanks for the email.  I am still trying to to learn how to think properly in kepler.  Any how the best solution  I can come up with is defining a parameter actor and setting the value using the VariableSetter actor. I believe you created this actor.  So if I set it to an array of strings dirList will be an array of string as in below.<br>*dirList  #"declare the variable as ParameterActor"<br>DirectoryListingActor -----> VariableSetterActor(with .variablename =dirList)<br><br>There might be a more elegant solution but that will have to wait until I know more of kepler.  As you pointed out you can do this with the various Expression like RExpression and others. BTW is there a hook to C++ in kepler?<br><br><br>Kind regards.<br><br>Ric<br>________________________________________<br>From: Edward A. Lee [<a href="mailto:eal@eecs.berkeley.edu">eal@eecs.berkeley.edu</a>]<br>Sent: Monday, 1 October 2012 7:02 AM<br>To: Pascual, Ricardo (CMAR, Dutton Park)<br>Cc: <a href="mailto:Kepler-users@kepler-project.org">Kepler-users@kepler-project.org</a>; <a href="mailto:cxh@eecs.berkeley.edu">cxh@eecs.berkeley.edu</a>; <a href="mailto:crawl@sdsc.edu">crawl@sdsc.edu</a><br>Subject: Re: [kepler-users] Kepler: Array instatiation and Array element assignment<br><br>Hi Ric,<br><br>I'm not sure what you mean by "programmatically."<br>What you describe below is a program in an imperative language.<br>In Kepler, the primary imperative language is Java. So you<br>could write an actor in Java that does this.<br><br>There are also hooks to write actors in MATLAB and Python,<br>which are also imperative languages.<br><br>If instead you are trying to define a workflow that builds<br>this variable, then the only director with an imperative<br>flavor is the FSM. I think it could be awkward to define<br>it in an FSM.<br><br>You could use a dataflow director or PN and SequenceToArray<br>actor, but these are distinctly not imperative.<br><br>In Kepler, parameters are defined as expressions in the<br>Ptolemy expression language.<br>The expression language is also not an imperative language.<br>It is a functional language. So you don't actually specify<br>sequences of steps for defining variables.<br><br>It occurs to me that it could be very useful to define<br>subclass of Parameter, say PythonParameter, that specifies<br>a parameter value that is initialized by running a Python<br>script... This would probably be fairly easy to write...<br>Any interest in this?<br><br>Edward<br><br><br><br>On 9/30/12 12:39 PM, <a href="mailto:Ricardo.Pascual@csiro.au">Ricardo.Pascual@csiro.au</a> wrote:<br><blockquote type="cite">Hi All,<br><br>Oooops wrong title.<br><br>Thanks,<br><br>Ric<br><br>________________________________________<br>From: <a href="mailto:kepler-users-bounces@kepler-project.org">kepler-users-bounces@kepler-project.org</a> [<a href="mailto:kepler-users-bounces@kepler-project.org">kepler-users-bounces@kepler-project.org</a>] On Behalf Of <a href="mailto:Ricardo.Pascual@csiro.au">Ricardo.Pascual@csiro.au</a> [<a href="mailto:Ricardo.Pascual@csiro.au">Ricardo.Pascual@csiro.au</a>]<br>Sent: Sunday, 30 September 2012 9:11 PM<br>To: <a href="mailto:Kepler-users@kepler-project.org">Kepler-users@kepler-project.org</a>; <a href="mailto:cxh@eecs.berkeley.edu">cxh@eecs.berkeley.edu</a>; <a href="mailto:crawl@sdsc.edu">crawl@sdsc.edu</a><br>Subject: [ExternalEmail] Re: [kepler-users] netCDF<br><br>Hi All,<br><br>I am about a week old into Kepler and having difficulty defining an array variable programmatically.  I have search the internet for this to no avail.   I know how to do it as a constant by assigning the value = {"x1", ...}.<br><br>What I like to do is define a variable with scope workflow wide say<br><br>string fileNames[];<br><br>then assign values to it as in<br><br>fileNames[0] = "file0"<br>fileNames[1] = "file1"<br><br><br>and so on.<br><br><br>Thank you very much,<br><br>Ric<br>_______________________________________________<br>Kepler-users mailing list<br><a href="mailto:Kepler-users@kepler-project.org">Kepler-users@kepler-project.org</a><br>http://lists.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-users<br>_______________________________________________<br>Kepler-users mailing list<br>Kepler-users@kepler-project.org<br>http://lists.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-users<br><br></blockquote><br></blockquote><span><eal.vcf></span>_______________________________________________<br>Kepler-users mailing list<br><a href="mailto:Kepler-users@kepler-project.org">Kepler-users@kepler-project.org</a><br>http://lists.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-users<br></blockquote></div><br></div></body></html>