Main Content

instantiate

Create analysis instance from specification

Description

example

instance = instantiate(model,properties,name) creates an instance of a model for analysis.

example

instance = instantiate(model,profile,name) creates an instance of a model for analysis with all stereotypes in a profile.

Examples

collapse all

Instantiate all properties of a stereotype that will be applied to specific elements during instantiation.

Create a profile for latency characteristics.

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;

Instantiate all properties of a stereotype.

model = systemcomposer.createModel('archModel');
NodeLatency = struct('elementKinds',['Component']);
ConnectorLatency = struct('elementKinds',['Connector']);
LatencyBase = struct('elementKinds',['Connector','Port','Component']);
PortLatency = struct('elementKinds',['Port']);
 
LatencyAnalysis = struct('NodeLatency',NodeLatency, ...
                'ConnectorLatency',ConnectorLatency, ...
                'PortLatency',PortLatency, ...
                'LatencyBase',LatencyBase);
            
properties = struct('LatencyProfile',LatencyAnalysis);
instantiate(model.Architecture,properties,'NewInstance')

Instantiate specific properties of a stereotype that will be applied to specific elements during instantiation.

NodeLatency = struct('elementKinds',["Component"], ...
                'properties',struct('resources',true));
ConnectorLatency = struct('elementKinds',["Connector"], ...
                'properties',struct('secure',true,'linkDistance',true));
LatencyBase = struct('elementKinds',[], ...
                'properties',struct('dataRate',true,'latency',false));
PortLatency = struct('elementKinds',["Port"], ...
                'properties',struct('queueDepth',true));
 
LatencyAnalysis = struct('NodeLatency',NodeLatency, ...
                'ConnectorLatency',ConnectorLatency, ...
                'PortLatency',PortLatency, ...
                'LatencyBase',LatencyBase);
            
properties = struct('LatencyProfile',LatencyAnalysis);
instantiate(model.Architecture,properties,'NewInstance')

Instantiate all stereotypes already in a profile that will be applied to elements during instantiation.

instantiate(model.Architecture,'LatencyProfile','NewInstance')

Input Arguments

collapse all

Model architecture from which instance is generated, specified as a systemcomposer.arch.Architecture object.

Example: model.Architecture

Structure containing profile, stereotype, and property information through which the user can specify which stereotypes and properties need to be instantiated.

Name of instance generated from the model, specified as a character vector.

Example: 'NewInstance'

Data Types: char

Profile name, specified as a character vector.

Example: 'LatencyProfile'

Data Types: char

Output Arguments

collapse all

Element instance, returned as a systemcomposer.analysis.ArchitectureInstance, systemcomposer.analysis.ComponentInstance, systemcomposer.analysis.PortInstance, or systemcomposer.analysis.ConnectorInstance object. This function is part of the instance API that you can use to analyze the model iteratively, element by element. The value refers to the element instance on which the iteration is being performed.

Introduced in R2019a