状态机(一)

来源:互联网 发布:招聘数据统计分析表 编辑:程序博客网 时间:2024/06/05 03:44

状态机概念术语

State Machine:状态机,驱动带有region、transition和event信息的状态集合。
State:一个状态模拟一个具体的情况,在这个情况发生的期间,会保持一些不变的条件。State是状态机中主要的实体,事件驱动状态的改变。
Extended State:扩展状态是保存在状态机中的一个特别的变量集合,用来减少必要的状态枚举的数量。
Transition:Transition建立源状态和目的状态之间的联系。可以是一个复杂Transition的一部分,Transition会使状态机从一个状态转换到另一个状态,代表状态机对一个特定事件的出现的完整的响应。
Event:Event实体被发送给状态机,然后引起不同的状态转换。
Initial State:是一个特别的状态,状态机从这个状态开始。Initial State总是被绑定到一个特定的State Machine或者Region。如果一个State Machine有多个Region的话,可能有多个State Machine。
End State:也叫Final State,Also called as a final state is a special kind of state signifying that the enclosing region is completed. If the enclosing region is directly contained in a state machine and all other regions in the state machine also are completed, then it means that the entire state machine is completed.
History State:一个伪状态,他记录了状态机上一个被激活的状态。有两种类型,shallow 和deep,shallow 只记录顶层的state,deep可以记录子状态机中的上一个活动的状态。
Choice State:伪状态,此状态可以根据事件的header或者Extended State中的变量做一个转移选择。
Fork State:一个伪状态。A pseudo state which gives a controlled entry into a regions.
Join State:
A pseudo state which gives a controlled exit from a regions.
Region:
A region is an orthogonal part of either a composite state or a state machine. It contains states and transitions.
Guard:一个布尔表达式,基于Extended State中的变量或者event参数的值动态的计算。当表达式被计算为true时,启用action或者transition,当表达式被计算为false时,禁用action或者transition,Guard条件通过上面的方式影响状态机的表现。
Action:action是触发transition时被执行的行为。

0 0
原创粉丝点击