main content

重构模型 -凯发k8网页登录

识别建模克隆件和模式以变换模型

使用模型变换器和克隆件检测器来重构模型,以改善模型组件化、可读性并支持重用。

使用模型变换器可以:

  • 确定可转换为 variant source 或 variant subsystem 模块的建模模式。使用 variant subsystemvariant source 模块有助于提高模型在不同条件表达式(称为变体选择项)中的重用率。活动模型是根据所选的变体选择项而激活的固定结构和可变组件的组合。

  • 标识符合消除条件的数据存储模块。消除数据存储模块可明确表现数据依存关系,从而提高模型的可读性。

  • 识别哪些 n-d lookup table 模块可转换为共享 prelookup 模块和多个 interpolation 模块。这种转换可提高仿真效率。

  • 识别在建模模式中可变换为单一 interpolation using prelookup 模块的多个 interpolation using prelookup 模块。这种变换可提高生成代码的效率。

使用克隆检测器可以:

  • 识别克隆件并创建模型,用指向库中子系统模块的链接替换克隆件。用指向库模块的链接替换克隆件可以实现组件重用。

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

函数

打开模型变换器
identify eligible interpolation using prelookup blocks to transform
replace interpolation using prelookup blocks
打开克隆检测器
find clones in a model
replace clones in a model
check equivalency of clone-replaced model and original model
highlight clone in a simulink model

results of search for eligible interpolation using prelookup blocks
refactored model results
conditions for findclones function
results of find clones
conditions for clone replacement function
results of replace clones
results of equivalency check

app

enable model transformation by identifying and refactoring the modelling patterns to optimize the models
通过标识和替换克隆,在模型中实现模型重构和子系统重用

主题

模型变换器


  • use the model transformer tool to transform a model into a variant system.

  • use the model transformer tool to make data dependency explicit in a model by replacing data store blocks with either a direct signal line, a delay block or a merge block.

  • use the model transformer tool to convert multiple n-d lookup table blocks into shared prelookup blocks and multiple interpolation blocks.

  • use the model transformer tool to transform a modeling pattern with multiple interpolation using prelookup blocks into a single interpolation using prelookup block.

克隆件检测器


  • use the clone detector app to replace subsystem clones with library blocks.

  • use the clone detector app to replace exact clones with subsystem reference blocks.

  • use the clone detection apis to identify and replace subsystem clones in a model.

  • use the clone detector to identify and replace clones across the model.
网站地图