内部框图中的块可以连接到自身吗?

Can a block in an Internal Block Diagram connect to itself?

我想描述的是系统中的4辆车可以相互通信。定义方块图时指定重数为4。这就是 IBD 的样子。这有意义吗?还是应该创建并连接 4 个单独的汽车实例?

简而言之

这个 IBD 表明这 4 辆车中的每一辆车都与另一辆车相连。但是根据您的叙述,每辆车都应该与其他 3 辆车相连。所以你应该在连接器的示教端放一个 3 multiplicity。

更多解释

根据 SysML 第 8.3.1.2 节:

An internal block diagram is based on the UML composite structure diagram, with restrictions and extensions as defined by SysML.

在这些 SysML 扩展中,有第 8.2.1.2.9 节:

SysML defines a default multiplicity of 1 on each end of a connector. These multiplicities may be assumed if not shown on a diagram.

在没有更具体的规则的情况下,连接器将被理解为 UML 中的复合结构:

For each instance playing a role in an internal structure, there will initially be as many links as indicated by the lower multiplicity of the opposite ends of Connectors attached to that role.

使用默认的 1 重数,这将导致阵列连接器模式(参见 UML 2.5.1,图 11.7 第 188 页),事实上,您将拥有 2 对联网汽车。

有了明确的 3 重数,您的图表将导致开始连接器模式(参见 UML,fig.11.6 page 188)。请注意,鉴于自引用,3 的重数就足够了。

当然,您也可以简单地绘制 4 个块并绘制它们之间存在的 6 个连接。很明确,确实需要较少的脑力来掌握设计的精神,但另一方面,它也使图表更加混乱。