状态,事件,状态转换函数(模型探讨)

849 阅读1分钟

定义组件c为:

c: S,E,F

其中,S为组件状态矩阵E为组件事件矩阵F为组件状态转移矩阵

事件类型 T定义为:

\bf T = \left[
    \begin{matrix}
        t_1\\
        t_2\\
        \vdots\\
        t_{i}
    \end{matrix}
\right]
\\

事件: e_{i} = t(c,t_i)

组件状态矩阵 S定义为:

\bf 设状态:S=\left[
    \begin{matrix}
       s_0 \\
       s_1  \\
       s_2 \\
       \vdots \\
       s_n \\
       s_{n+1}
    \end{matrix} 
    \right]
    
    \\ \\
    \tag{1}

其中

s_0为初始状态 \\

s_{n+1}为状态n经过状态转换函数f_{i,n}后的状态

一个业务逻辑可以表示为从一个状态i到一个状态j的转移过程:

b_{i,j} = s_i \dots s_j \\
\tag{2}

组件事件矩阵 E定义为:

\bf 设事件:E=\left[
    \begin{matrix}
        e_1 \\
        e_2 \\
        \vdots \\
        e_m
    \end{matrix}
\right]
\\ 
\tag{3}

定义:组件状态转换矩阵 F

\bf F=\left[
    \begin{matrix}
        f_{0,1}(s_0,e_1) & f_{0,2}(s_0,e_2) & \cdots & f_{0,n}(s_0,e_n)\\
        f_{1,1}(s_1,e_1) & f_{1,2}(s_1,e_2) & \cdots & f_{1,n}(s_1,e_n)\\
        \vdots & \vdots & \cdots & \vdots \\
        f_{m,1}(s_m,e_1) & f_{m,2}(s_m,e_2) & \cdots & f_{m,n}(s_m,e_n)
    \end{matrix}
\right]
\tag{4}

其中

f_{i,j}(s_i,e_j) = s_{i+1}
\tag{5}

组件矩阵C定义为:

\bf 设组件:C=\left[
    \begin{matrix}
        c_1\\
        c_2\\
        \vdots\\
        c_j
    \end{matrix}
\right]
\tag{6}

一个页面p可以定义为:

p = p(C)
\tag{7}