gpt4 book ai didi

UML 状态机浅层历史

转载 作者:行者123 更新时间:2023-12-04 19:46:10 24 4
gpt4 key购买 nike

我想知道我是否正确理解了 ShallowHistory 语法。

这是正确的使用方式吗?

enter image description here

在 UML 规范中。据说它可以用来代替初始的伪状态。我猜想在这种情况下将无法重置 State1 的内存,而在这种情况下从 State0 的转换总是从 State1.1 开始。我说得对吗?

最佳答案

您的解释似乎是正确的。来自上层建筑:

Upon entering a composite state, the following cases are differentiated:

• Default entry: Graphically, this is indicated by an incoming transition that terminates on the outside edge of the composite state. In this case, the default entry rule is applied (see Semantic variation point (default entry rule)).

Semantic variation point (default entry rule)

If a transition terminates on an enclosing state and the enclosed regions do not have an initial pseudostate, the interpretation of this situation is a semantic variation point.In some interpretations, this is considered an ill-formed model. That is, in those cases the initial pseudostate is mandatory. An alternative interpretation allows this situation and it means that, when such a transition is taken, the state machine stays in the composite state, without entering any of the regions or their substates.

最后:

Shallow history entry: If the transition terminates on a shallow history pseudostate, the active substate becomes the most recently active substate prior to this entry, unless the most recently active substate is the final state or if this is the first entry into this state. In the latter two cases, the default history state is entered. This is the substate that is target of the transition originating from the history pseudostate. (If no such transition is specified, the situation is ill-defined and its handling is not defined.) If the active substate determined by history is a composite state, then it proceeds with itsdefault entry.

请注意,从上一段来看,您似乎应该始终从 H 伪状态转换到 initial 伪状态指​​向的相同状态,否则您可能有一台定义不明确的机器。

我没有找到它说你可以使用 H* 而不是初始伪状态的地方。你在哪里看到的?

关于UML 状态机浅层历史,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14681430/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com