メインコンテンツ

このページの内容は最新ではありません。最新版の英語を参照するには、ここをクリックします。

モデルのリファクタリング

モデリング クローンとパターンを特定してモデルを変換

モデル トランスフォーマーおよびクローン検出器を使用してモデルをリファクタリングし、モデルのコンポーネント化と可読性を改善して再利用を可能にします。

モデル トランスフォーマーを使用して次を実行します。

  • Variant Source ブロックまたは Variant Subsystem ブロックへの変換の条件を満たすモデル化パターンを特定します。Variant Subsystem ブロックと Variant Source ブロックを使用すると、バリアント選択と呼ばれるさまざまな条件式でのモデルの再利用が可能になります。アクティブなモデルでは、ユーザーのバリアント選択に従ってアクティブにした固定構造および可変コンポーネントが組み合わされています。

  • 削除の条件を満たすデータ ストア ブロックを特定します。データ ストア ブロックを削除すると、データの依存関係が明示的になるため、モデルの可読性が改善されます。

  • 共有 Prelookup ブロックおよび複数の Interpolation ブロックへの変換の条件を満たす n-D Lookup Table ブロックを特定します。この変換により、シミュレーションの効率が向上します。

  • モデル化パターンの単一の Interpolation Using Prelookup ブロックへの変換条件を満たす複数の Interpolation Using Prelookup ブロックを特定します。この変換により、生成されたコードの効率が向上します。

クローン検出器を使用して、次を実行します。

  • クローンを特定し、それらのクローンをライブラリ内のサブシステム ブロックへのリンクに置き換えたモデルを作成します。クローンをライブラリ ブロックへのリンクに置き換えると、コンポーネントの再利用が可能になります。

  • サブシステム参照を使用して、モデル内のクローンを特定して置換します。

関数

すべて展開する

mdltransformerモデル トランスフォーマーを開く
Simulink.ModelTransform.BusTransformation.identifyIdentify Bus Selector and Bus Creator blocks to transform (R2022b 以降)
Simulink.ModelTransform.BusTransformation.refactorReplace Bus Selector and Bus Creator blocks with In Bus Element and Out Bus Element blocks (R2022b 以降)
Simulink.ModelTransform.CommonSourceInterpolation.identifyCandidates変換に適格な Interpolation Using Prelookup ブロックを特定する (R2021b 以降)
Simulink.ModelTransform.CommonSourceInterpolation.refactorModelInterpolation Using Prelookup ブロックを置き換える (R2021b 以降)
clonedetectionクローン検出器アプリを開く
Simulink.CloneDetection.findClonesFind clones in a model (R2021a 以降)
Simulink.CloneDetection.replaceClonesReplace clones in a model (R2021a 以降)
Simulink.CloneDetection.checkEquivalencyCheck equivalency of clone-replaced model and original model (R2021a 以降)
Simulink.CloneDetection.highlightCloneHighlight clone in a Simulink model (R2021b 以降)
Simulink.CloneDetection.generateReportGenerate clone detection report (R2023b 以降)
Simulink.CloneDetection.addExclusionsExclude component from clone detection (R2025a 以降)
Simulink.CloneDetection.getExclusionsGet list of components excluded from clone detection (R2025a 以降)
Simulink.CloneDetection.deleteExclusionsRemove component from clone detection exclusion list (R2025a 以降)

クラス

すべて展開する

Simulink.ModelTransform.BusTransformation.ResultResults of identified Bus Selector and Bus Creator blocks (R2022b 以降)
Simulink.ModelTransform.CommonSourceInterpolation.Results適格な Interpolation Using Prelookup ブロックの検索結果 (R2021b 以降)
Simulink.ModelTransform.CommonSourceInterpolation.RefactorResultsリファクタリングされたモデル結果 (R2021b 以降)
Simulink.CloneDetection.Settings 関数 findClones の条件 (R2021a 以降)
Simulink.CloneDetection.Resultsクローンの検索結果 (R2021a 以降)
Simulink.CloneDetection.ReplacementConfigConditions for clone replacement function (R2021a 以降)
Simulink.CloneDetection.ReplacementResultsResults of replace clones (R2021a 以降)
Simulink.CloneDetection.EquivalencyCheckResultsResults of equivalency check (R2021a 以降)

アプリ

モデル トランスフォーマーモデルを最適化するためにモデリング パターンを特定してリファクタリングすることで、モデル変換を有効にする
クローン検出器クローンを特定して置き換えることで、モデル内でモデルのリファクタリングやサブシステムの再利用を可能にする

トピック

モデル トランスフォーマー

クローン検出器

注目の例