メインコンテンツ

allocate

新しい割り当てを作成

    説明

    allocation = allocate(allocScenario,sourceElement,targetElement) は、ソース要素 sourceElement とターゲット要素 targetElement の間の新しい割り当てを作成します。

    割り当てを削除するには、deallocate 関数を使用します。

    すべて折りたたむ

    それぞれ 1 つのコンポーネントをもつ 2 つの新しいモデルを作成します。

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

    モデル間でコンポーネントの割り当てを行います。

    allocation = allocate(defaultScenario,sourceComp,targetComp);

    割り当てセットを現在のディレクトリに保存します。

    save(allocSet)

    割り当てエディターを開きます。

    systemcomposer.allocation.editor

    入力引数

    すべて折りたたむ

    割り当てシナリオ。systemcomposer.allocation.AllocationScenario オブジェクトとして指定します。

    ソース要素。systemcomposer.arch.Element オブジェクトとして指定します。

    要素オブジェクトは、systemcomposer.arch.Componentsystemcomposer.arch.Adaptersystemcomposer.arch.VariantComponentsystemcomposer.arch.ComponentPort、ルートの systemcomposer.arch.ArchitecturePortsystemcomposer.arch.PortElementsystemcomposer.arch.Connector、または systemcomposer.arch.PhysicalConnector のいずれかのオブジェクトになります。

    ターゲット要素。systemcomposer.arch.Element オブジェクトとして指定します。

    要素オブジェクトは、systemcomposer.arch.Componentsystemcomposer.arch.Adaptersystemcomposer.arch.VariantComponentsystemcomposer.arch.ComponentPort、ルートの systemcomposer.arch.ArchitecturePortsystemcomposer.arch.PortElementsystemcomposer.arch.Connector、または systemcomposer.arch.PhysicalConnector のいずれかのオブジェクトになります。

    出力引数

    すべて折りたたむ

    ソースとターゲットの要素間の割り当て。systemcomposer.allocation.Allocation オブジェクトとして返されます。

    詳細

    すべて折りたたむ

    バージョン履歴

    R2020b で導入