下面本质是一个动力学差分方程,也可以说是状态机
@freezedsealedclassSwith_$S {
constfactoryS.s0() =S0;
constfactoryS.s1() =S1;
}
@freezedsealedclassAwith_$A {
constfactoryA.a0() =A0;
constfactoryA.a1() =A1;
}
@CmsGraph()
classMextendsCms<S, A> {
M() :super(.s0());
// dart format off@overrideFuture<S?> kernel(S s, A a) async=>switch ((s, a)) {
(S0 _, A0 _) => () {
if (Random().nextBool()) returnS.s1();
returnS.s1();
}(),
(S1 _, A1 _) => .s0(),
_ =>undefined(s, a),
};
// dart format on
}我想对其积分,看到其演化。通过 @CmsGraph() 来做到
xstate 画出了图像
下面本质是一个动力学差分方程,也可以说是状态机
我想对其积分,看到其演化。通过
@CmsGraph()来做到xstate 画出了图像