Main Content

Variant object

Store alternate component values


The SimBiology® variant object stores the names and values of model components and allows you to use the values stored in a variant object as the alternate value to be applied during a simulation. You can store values for species InitialAmount, parameter Value, and compartment Capacity in a variant object. Simulating using a variant does not alter the model component values. The values specified in the variant temporarily apply during simulation.

Using one or more variant objects associated with a model allows you to evaluate model behavior during simulation, with different values for the various model components without having to search and replace these values, or having to create additional models with these values. If you determine that the values in a variant object accurately define your model, you can permanently replace the values in your model with the values stored in the variant object, using the commit method.

To use a variant in a simulation you must add the variant object to the model object and set the Active property of the variant to true. Set the Active property to true if you always want the variant to be applied before simulating the model. You can also enter the variant object as an argument to sbiosimulate; this applies the variant only for the current simulation and supersedes any active variant objects on the model.


The Active property of the Variant object will be removed in a future release. Explicitly specify a variant or an array of variants as an input argument when you simulate a model using sbiosimulate.

When there are multiple active variant objects on a model, if there are duplicate specifications for a property's value, the last occurrence for the property value in the array of variants, is used during simulation. You can find out which variant is applied last by looking at the indices of the variant objects stored on the model. Similarly, in the Content property, if there are duplicate specifications for a property's value, the last occurrence for the property in the Content property, is used during simulation.

Use the addcontent method to append contents to a variant object.

See Property Summary for links to species property reference pages. Properties define the characteristics of an object. Use the get and set commands to list object properties and change their values at the command line. You can graphically change object properties in the graphical user interface.

Constructor Summary

sbiovariantConstruct variant object

Method Summary

Methods for variant objects

addcontent (variant)Append content to variant object
commit (variant)Commit variant contents to model
copyobjCopy SimBiology object and its children
deleteDelete SimBiology object
displayDisplay summary of SimBiology object
getGet SimBiology object properties
renameRename SimBiology model component and update expressions
rmcontent (variant)Remove contents from variant object
setSet SimBiology object properties
verify (model, variant)Validate and verify SimBiology model

Property Summary

Properties for variant objects

ActiveIndicate object in use during simulation
ContentContents of variant object
NameSpecify name of object
NotesHTML text describing SimBiology object
ParentIndicate parent object
TagSpecify label for SimBiology object
TypeDisplay SimBiology object type
UserDataSpecify data to associate with object

Version History

Introduced in R2008a