SYSML中的多态性

发布于 2025-01-18 13:11:22 字数 254 浏览 0 评论 0原文

目前,我正在尝试设计可执行活动的活动,其中逻辑组件将请求发送给其他几个逻辑组件以开始初始化。活动图的通常方法是为每个街区创建一个游泳线。但是,由于LC的数量很高,在这种情况下,该图将非常大,后来其修改将是一个障碍。

在编程中,解决此问题的解决方案是多态性,其中将对象施放为母班并将其推入向量,然后在循环中,称为母类的抽象功能。

我想知道SYSML中是否有类似的解决方案?

我试图将一个游泳线分配给收到请求的所有LCS,但似乎每个游泳线只能分配给一个块。

currently i am trying to design an executable activity where a logical component send a request to several other logical components to start initialization. The usual way in activity diagram is to create for each block a swimline. But, as the number of LCs are high in this case the diagram will be extremely big and also later its modification will be a hurdle.

In programming, the solution to this problem is polymorphism where the objects are casted as the mother class and pushed into a vector and then within the loop the abstract function of the mother class is called.

I wonder if there is any similar solution to this problem in sysml or not?

I tried to assign one swimline to the all the LCs which recevie the request but it seems each swimline can only be assigned to a block.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

子栖 2025-01-25 13:11:22

是的,也有类似的解决方案。实际上,这甚至更容易。只需让ActivTypartition代表具有大于1的属性即可。该分区中的任何InvocationAction都意味着对本属性中所有实例的同时调用。

UML规范对此说:

第15.6.3.1节活动分区

如果该属性具有多个值,则
调用被视为同时在每个
在所有并发之前,价值和调用才能完成
完整的实例。

典型的调用actactions是呼叫和发送标志性。因此,您可以在代表属性mylogicalComponents的分区中调用initialize()操作:lc [1 ..*]

如果您尚未定义此类属性,则可以通过使其成为派生的联合来得出它,然后将所有现有属性定义为以其为子集初始化的组件的所有现有属性:

/myLogicalComponents:LC[1..*]{union}
LC1:LC {subsets myLogicalComponents}
LC2:LC {subsets myLogicalComponents}

当然,假设您所有的逻辑组件都正在专门化lc,以便它们都继承并重新定义initialize()操作。

在SYSML中,您还具有分配分区。没有描述清晰的语义,因此我认为您最好与UML Activity分区一起使用,这些活动也包含在SYSML中。

Yes, there is a similar solution. Actually, it is even easier. Just let the ActivtyPartition represent a property with a multiplicity greater than 1. Any InvocationAction in this partition will then mean a concurrent invocation on all instances held in this property.

The UML specification says about this:

section 15.6.3.1 Activity Partitions

If the Property holds more than one value, the
invocations are treated as if they were made concurrently on each
value and the invocation does not complete until all the concurrent
instances of it complete.

Typical InvocationActions are CallActions and SendSignalActions. So, you could call the initialize() operation in a partition representing the property myLogicalComponents:LC[1..*].

If you don't already have defined such a property, you can derive it, by making it a derived union and then define all existing properties with components to be initialized as subsets of it:

/myLogicalComponents:LC[1..*]{union}
LC1:LC {subsets myLogicalComponents}
LC2:LC {subsets myLogicalComponents}

Of course, this assumes, that all your logical components are specializing LC, so that they all inherit and redefine the initialize() operation.

In SysML you also have AllocateActivityPartitions. No clear semantics is described for it, so I think you are better served with the UML ActivityPartitions, which are also included in SysML.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文