-
Notifications
You must be signed in to change notification settings - Fork 0
Open
0 / 10 of 1 issue completedDescription
下面本质是一个动力学差分方程,也可以说是状态机
@freezed
sealed class S with _$S {
const factory S.s0() = S0;
const factory S.s1() = S1;
}
@freezed
sealed class A with _$A {
const factory A.a0() = A0;
const factory A.a1() = A1;
}
@CmsGraph()
class M extends Cms<S, A> {
M() : super(.s0());
// dart format off
@override
Future<S?> kernel(S s, A a) async => switch ((s, a)) {
(S0 _, A0 _) => () {
if (Random().nextBool()) return S.s1();
return S.s1();
}(),
(S1 _, A1 _) => .s0(),
_ => undefined(s, a),
};
// dart format on
}我想对其积分,看到其演化。通过 @CmsGraph() 来做到
xstate 画出了图像
Sub-issues
Metadata
Metadata
Assignees
Labels
No labels