Import SAM models into the SDK

7 posts / 0 new
Last post
sfrank
sfrank's picture
Import SAM models into the SDK

Is there a way to import data from a SAM model (.zsam or the new .sam format) via the SDK? (Or, will this be supported in the next SDK release along with the revamped .sam file format?)

What I would like to do is create a standard model using the SAM GUI, then perturb it via the SDK to do some exploratory research.

Paul Gilman

Hello,

We've got that feature on our To Do list, but it's not near the top at the moment. Thanks for the suggestion!

The new version of SAM (now in Beta test) has an input variable browser that lists all input variables in your SAM file with the internal variable name in addition to the labels you see in the user interface and their values. You can (manually) select and copy the table and then paste it into a text editor or spreadsheet program. You still have to do a fair amount of processing that data to turn it into code for the SDK, but it does give you a complete list of the input variables.

Best regards,
Paul.

sfrank
sfrank's picture

Ok, good to know, especially about the input variable browser. That will at least simplify the process of porting a model from the SAM GUI to the SDK. Thanks!

sfrank
sfrank's picture

Ok, I have a follow-up comment. SSC's SDKtool has a very nice display in the module browser which gives detailed information about the input variables (name, type, etc.) needed to run SSC. What would be excellent would be a way to this same type of interface (either within SAM itself or by import to the SDKtool) with an added column that displays the current value of the variable. This would make it much easier to construct a baseline model for perturbation via the SDK.

Instead, what I have do down now is either (per-beta) parse the SSC txt file that gets dumped into $HOME\.sam\ssc, or (post-beta) copy the values in the new input variable browser and then match them (manually or via a script) to the SSC inputs obtained from the SDKtool. Having all this data in one place in a standard format would really streamline the process.

Paul Gilman

I'm not sure I understand your request. The inputs browser (Beta version) shows the SSC variable name, user interface label, and value for all of the input variables in each case in the file, which seems like enough information to transfer inputs to the SDK (albeit manually or via script). Would you like it to show additional information? Because it is intended for people using SAM, not developers using the SDK, I'm not sure it makes sense to show the other variable meta data that you see in SDKtool.

We're discussing some enhancements to the inputs browser this week, so your comments are timely. I think we will implement something to make it easier to export the information in the table to CSV so you at least don't have to cut and paste by hand.

Thanks for the feedback!

Best regards,
Paul.

danielenderton

I'd just like to chime in that I'd also welcome sfrank's original request of having a way to import a setup (.sam file) into SDK. Would be very useful.

Thanks for all the support of SAM. It is appreciated.

Daniel

Paul Gilman

Hello Daniel,

We are now working on a new feature for the next version of SAM that will export code from the SAM user interface for each of the compute modules used by the case in SAM. The code will set the values of input variables for each of the compute modules and make a call to each compute module. You will be able to choose whether to export the code in LK script to use with SDKtool, or in C or one the languages of the wrappers provided with the SDK.

That should be ready sometime around the end of this calendar year (2016).

Best regards,
Paul.

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer