getAllocatedFrom - Get allocation source - MATLAB (original) (raw)
Main Content
Get allocation source
Since R2020b
Syntax
Description
[sourceElements](#mw%5Ff2708157-9d53-461e-81c3-79c099f7c924) = getAllocatedFrom([allocScenario](#mw%5F6812ed11-1752-4623-b51c-def69be25705%5Fsep%5Fmw%5F1a141857-61e3-4a9d-beb8-79d81202af40),[targetElement](#mw%5F6812ed11-1752-4623-b51c-def69be25705%5Fsep%5Fmw%5F1cc3dc6f-b0c3-4e61-bdcf-591e8facb7be))
gets all allocated source elements from which a target elementtargetElement
is allocated.
Examples
Create two new models with one component each.
mSource = systemcomposer.createModel("Source_Model_Allocation"); systemcomposer.openModel("Source_Model_Allocation"); sourceComp = addComponent(get(mSource,"Architecture"),"Source_Component"); mTarget = systemcomposer.createModel("Target_Model_Allocation"); systemcomposer.openModel("Target_Model_Allocation"); targetComp = addComponent(get(mTarget,"Architecture"),"Target_Component");
Create an allocation set named MyNewAllocation
.
allocSet = systemcomposer.allocation.createAllocationSet("MyNewAllocation",... "Source_Model_Allocation","Target_Model_Allocation");
Get the default allocation scenario.
defaultScenario = getScenario(allocSet,"Scenario 1");
Allocate components between models.
allocation = allocate(defaultScenario,sourceComp,targetComp);
Get allocated from source component allocated to target component.
sourceElement = getAllocatedFrom(defaultScenario,targetComp)
sourceElement =
Component with properties:
IsAdapterComponent: 0
Architecture: [1×1 systemcomposer.arch.Architecture]
Name: 'Source_Component'
Parent: [1×1 systemcomposer.arch.Architecture]
Ports: [0×0 systemcomposer.arch.ComponentPort]
OwnedPorts: [0×0 systemcomposer.arch.ComponentPort]
OwnedArchitecture: [1×1 systemcomposer.arch.Architecture]
Position: [15 15 65 76]
Model: [1×1 systemcomposer.arch.Model]
SimulinkHandle: 2.0001
SimulinkModelHandle: 1.2207e-04
UUID: 'c5ab7c89-3ebc-4a19-934b-9b0f473a0737'
ExternalUID: ''
Input Arguments
Output Arguments
More About
Version History
Introduced in R2020b
See Also
Tools
Blocks
Objects
- systemcomposer.allocation.Allocation | systemcomposer.allocation.AllocationScenario | systemcomposer.allocation.AllocationSet
Functions
- systemcomposer.allocation.createAllocationSet | systemcomposer.allocation.load | systemcomposer.allocation.open | systemcomposer.allocation.editor | close | systemcomposer.allocation.AllocationSet.closeAll | systemcomposer.allocation.AllocationSet.find | save | rebindSourceModel | rebindTargetModel | synchronizeChanges | createScenario | deleteScenario | getScenario | allocate | deallocate | getAllocation | getAllocatedTo | destroy