主要内容

本页采用了机器翻译。点击此处可查看最新英文版本。

getScenario

获取分配方案

    说明

    scenario = getScenario(allocSet,name) 获取分配集 allocSet 中名称为 name 的分配方案(如果存在)。

    示例

    示例

    全部折叠

    创建两个新模型,每个模型有一个组件。

    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");

    创建一个名为 MyNewAllocation 的分配集。

    allocSet = systemcomposer.allocation.createAllocationSet("MyNewAllocation",...
         "Source_Model_Allocation","Target_Model_Allocation");

    获取默认分配方案。

    defaultScenario = getScenario(allocSet,"Scenario 1")
    defaultScenario = 
    
      AllocationScenario with properties:
    
                 Name: 'Scenario 1'
          Description: ''
        AllocationSet: [1×1 systemcomposer.allocation.AllocationSet]
          Allocations: [0×0 systemcomposer.allocation.Allocation]
                 UUID: '6cde23e8-7c72-4fa0-8f51-e65290208564'

    输入参数

    全部折叠

    分配集,指定为 systemcomposer.allocation.AllocationSet 对象。

    分配方案的名称,指定为字符向量或字符串。

    示例: "Scenario 1"

    数据类型: char | string

    输出参量

    全部折叠

    分配方案,以 systemcomposer.allocation.AllocationScenario 对象的形式返回。

    详细信息

    全部折叠

    版本历史记录

    在 R2020b 中推出