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 CenterFile Exchange에서 Extend Modeling Environment에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by