Main Content

update

Update architecture model

Description

update(instance) updates a specification model to mirror the changes in the architecture instance instance. The update method is part of the systemcomposer.analysis.ArchitectureInstance class.

Note

This function is part of the instance programmatic interfaces that you can use to analyze the model iteratively, element-by-element. The instance refers to the element instance on which the iteration is being performed.

example

Examples

collapse all

Update the specification model to mirror the changes in the architecture instance.

Create a profile for latency characteristics and save it.

profile = systemcomposer.profile.Profile.createProfile("LatencyProfile");

latencybase = profile.addStereotype("LatencyBase");
latencybase.addProperty("latency",Type="double");
latencybase.addProperty("dataRate",Type="double",DefaultValue="10");

connLatency = profile.addStereotype("ConnectorLatency",...
Parent="LatencyProfile.LatencyBase");
connLatency.addProperty("secure",Type="boolean");
connLatency.addProperty("linkDistance",Type="double");

nodeLatency = profile.addStereotype("NodeLatency",...
Parent="LatencyProfile.LatencyBase");
nodeLatency.addProperty("resources",Type="double",DefaultValue="1");

portLatency = profile.addStereotype("PortLatency",...
Parent="LatencyProfile.LatencyBase");
portLatency.addProperty("queueDepth",Type="double");
portLatency.addProperty("dummy",Type="int32");

profile.save

Create a new model. Apply the profile to the model. Apply the stereotype to the architecture. Instantiate all stereotypes in a profile.

model = systemcomposer.createModel("archModel");
systemcomposer.openModel("archModel");
model.applyProfile("LatencyProfile");
model.Architecture.applyStereotype("LatencyProfile.LatencyBase");
instance = instantiate(model.Architecture,"LatencyProfile","NewInstance");

Set a new value for the "dataRate" property on the architecture instance.

instance.setValue("LatencyProfile.LatencyBase.dataRate",5);

Update the specification model according to the architecture instance.

instance.update

Get the new value of the "dataRate" property on the architecture.

value = model.Architecture.getPropertyValue("LatencyProfile.LatencyBase.dataRate")
value =

    '5'

Input Arguments

collapse all

Architecture instance for which specification model is updated, specified as a systemcomposer.analysis.ArchitectureInstance object.

More About

collapse all

Version History

Introduced in R2019a