getAllocation - Get allocation between source and target elements - MATLAB (original) (raw)
Main Content
Get allocation between source and target elements
Since R2020b
Syntax
Description
[allocation](#mw%5F71fe6480-1191-4395-8de0-48de5be51cac) = getAllocation([allocScenario](#mw%5F42a3f36d-1750-4b6f-824d-6a0a7c47a553%5Fsep%5Fmw%5F1a141857-61e3-4a9d-beb8-79d81202af40),[sourceElement](#mw%5F42a3f36d-1750-4b6f-824d-6a0a7c47a553%5Fsep%5Fmw%5F0d3207ca-dd8a-4c66-8e17-3542e0b3e81d),[targetElement](#mw%5F42a3f36d-1750-4b6f-824d-6a0a7c47a553%5Fsep%5Fmw%5F1cc3dc6f-b0c3-4e61-bdcf-591e8facb7be))
gets the allocation, if one exists, between the source elementsourceElement
and the target elementtargetElement
.
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 the allocation between the source component and the target component.
allocation = getAllocation(defaultScenario,sourceComp,targetComp)
allocation =
Allocation with properties:
Source: [1×1 systemcomposer.arch.Component]
Target: [1×1 systemcomposer.arch.Component]
Scenario: [1×1 systemcomposer.allocation.AllocationScenario]
UUID: 'd83d692d-03fa-4186-977c-ce31b9de9630'
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 | getAllocatedFrom | getAllocatedTo | destroy