主要内容

Refactor Models

Identify modeling clones and patterns to transform model

Use the Model Transformer and the Clone Detector to refactor a model to improve model componentization, readability and enable reuse.

Use the Model Transformer to:

  • Identify modeling patterns that qualify for transformation into Variant Source or Variant Subsystem blocks. Using变体子系统Variant Source块有助于对模型的可重复使用,以获取称为变体选择的不同条件表达式。活动模型是固定结构和可变组件的组合,您可以根据您选择的变体选择而激活。

  • 确定有资格消除的数据存储块。消除数据存储块通过明确使数据依赖性提高模型可读性。

  • Identify n-D Lookup Table blocks that qualify for transformation into sharedPrelookupblocks and multiple插值块。This transformation improves the simulation efficiency.

  • 识别多个插值使用Prelookup提单ocks that qualify for transformation into a single Interpolation Using Prelookup block in a modeling pattern. This transformation improves the generated code efficiency.

使用克隆探测器来:

  • Identify clones and create a model with the clones replaced by links to the subsystem blocks in a library. Replacing clones with links to library blocks enables component reuse.

  • 用子系统参考识别并替换模型中的克隆。

Functions

expand all

mdltransformer 开放模型变压器
Simulink.ModelTransform.CommonSourceInterpolation.identifyCandidates Identify eligible Interpolation Using Prelookup blocks to transform
Simulink.ModelTransform.CommonSourceInterpolation.refactorModel Replace Interpolation Using Prelookup blocks
克隆觉 Open Clone Detector app
Simulink.CloneDetection.findClones Find clones in a model
万博1manbetxsimulink.clonedetection.replaceclones Replace clones in a model
Simulink.CloneDetection.checkEquivalency Check equivalency of clone-replaced model and original model
Simulink.CloneDetection.highlightClone Highlight clone in a Simulink model

Classes

expand all

Simulink.ModelTransform.CommonSourceInterpolation.Results Results of search for eligible Interpolation Using Prelookup blocks
万博1manbetxsimulink.modeltransform.commonsourceinterpolation.refactorresults Refactored model results
Simulink.CloneDetection.Settings Conditions for findClones function
Simulink.CloneDetection.Results 查找克隆的结果
Simulink.CloneDetection.ReplacementConfig 克隆替换功能的条件
Simulink.CloneDetection.ReplacementResults 替换克隆的结果
Simulink.CloneDetection.EquivalencyCheckResults Results of equivalency check

Apps

Clone Detector 通过使用库链接或子系统参考来识别和替换克隆,启用模型中的模型重构和子系统重复使用

Topics

Model Transformer

Clone Detector