SimBiology Model Matching Policy
To report the differences between the source and target models, SimBiology® first decides which components of the models match one another. The matching process includes the following criteria:
Criterion 1 – Two components are considered the same if both are derived from one single model. For instance, duplicated models in the app, or the same models saved to and loaded from different versions of SBPROJ files, are derived from one single model.
Criterion 2 – Two components are considered equivalent if criterion 1 is not applicable to these components but they can be uniquely matched by one of the corresponding properties, such as
Name
,Reaction
,Rule
, and so on.
The following sections describe how SimBiology matches different types of model components.
Model Quantities
Model quantities include species, compartments, and parameters. SimBiology first
matches them using criterion 1. Then, it matches all the remaining quantities using
criterion 2. That is, components of the same type that have not yet been matched are
compared by the Name
property. However, parameters are matched
only if they are scoped to matching reactions or if one of the parameters is
model-scoped.
Model Expressions
Expression-based components are reactions, rules, events, and observables.
SimBiology matches these components using criterion 1 first. Then it matches all
the remaining expression-based components using criterion 2. That is, components of
the same type that have not yet been matched are compared by the
Name
property and one of the following properties for
reactions, rules, and events:
Reaction
property for reactionsRule
property for rulesTrigger
property for events
SimBiology accounts for the changes in these properties (the
expression strings) that are caused by the dependent changes. The dependent changes
are the side effects of changing the Name
,
Parent
, or Owner
properties of a
quantity component. When these properties change, they trigger changes in other
components referencing the quantity. For instance, the Reaction
property of a reaction C1.S1 -> C1.S2
changes to
C1.S3 -> C1.S2
when you rename the species
S1 residing in a compartment C1 to
S3
. Such changes are not included in the comparison results
of sbiodiff
. If you are using the Comparison
tool, such changes are automatically hidden.
For kinetic law objects, they match if their parent reactions match.
Doses and Variants
Variants and doses are matched using criterion 1 first. Then the remaining doses
and variants are matched using criterion 2. That is, components of the same type
that have not yet been matched are compared by the Name
property.
Note that for doses, the subtype (RepeatDose
or
ScheduleDose
) must match also.
Variants can contain multiple rows in their corresponding Content property. Each row of the
Content
cell array includes values for the component type,
component name, property name, and property value. When comparing variants with such
content, SimBiology matches the property names of the rows and reports the last
occurrence if there are duplicate rows with the same component type and component
name.
Determine Differences in Component Properties
After model components are matched, SimBiology next determines if the property
values of matching components are different. All properties (except the
UserData
property) of each model component are included in
the comparison results.
If either model has a diagram, SimBiology also reports any graphical differences between the diagrams. Specifically, it includes the following properties of graphical blocks of the corresponding model components and graphical lines.
Graphical block properties:
Position
,Visible
,Pin
,Shape
,Rotate
,FontName
,FontSize
,FontWeight
,TextLocation
,FaceColor
,EdgeColor
, andTextColor
.Graphical line properties:
Color
andWidth
.
Each of these graphical block properties is reported as a property of the corresponding model component in the comparison results. Similarly, if species blocks have any clones, the clones are also matched and reported as properties of the parent block.
See Also
sbiodiff
| SimBiology.DiffResults
| getComponents
| visdiff