Can I create a variant that captures all current parameter, species and compartment values?

1 回表示 (過去 30 日間)
So I'd like to be able to do something like this:
sbr = sbioroot; % Get the root object
lastn = length(sbr.models); % Get index of the last model object (presumably the one I'm using)
ml = sbr.models(lastn); % Get a handle for the model in use;
varobj = sbiovariant('Current'); % add a variant to that model
varobj = addcontent(varobj,allcurrentcontent(m1));
or perhaps instead of "all current content" I could use more granular commands, as in the desktop. In interactive mode, I can "add all species", "add all compartments" and "add all parameters" to a variant.
So perhaps
varobj = addcontent(varobj,m1.species);
varobj = addcontent(varobj,m1.parameters);
varobj = addcontent(varobj,m1.compartments);
Ideally, the sbiovariant command would allow a flag. All, Species, Compartments, and Parameters. So
varobj = sbiovariant('Current','All'); % adds a variant containing all numbers to the current model
Or is there already something like this that I'm missing?
Thanks!

採用された回答

Arthur Goldsipe
Arthur Goldsipe 2018 年 10 月 1 日
You're not overlooking anything. We just need to make variants easier to use. Right now, I would probably do this by making a helper function with a "for loop" to add each item to the variant.
Also, one note. There are two ways to make a variant in SimBiology. When you call "sbiovariant" you are making a "standalone" variant. You can also call "addvariant" to create a variant that is stored on your model. One reason to make a standalone variant is if you want to use it with multiple related models.
  1 件のコメント
Jim Bosley
Jim Bosley 2018 年 10 月 2 日
Thanks, Arthur. Appreciate the explanation of add_ vs sbio-variant.
As I understand it, one could (for example) take the model object, extract m1par = m1.parameters, and then loop through the list by adding m1par(i) to the variant. Makes sense.
Agree - variants have power now, and could be even more powerful. I'd really like to be able to turn rules on and off using variants.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeExtend Modeling Environment についてさらに検索

タグ

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by