扩展的有限状态机问题 [英] Extended finite state machine problem

查看:89
本文介绍了扩展的有限状态机问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我有一个带有主EFSM(PCOXS中央泵)的C ++嵌入式系统项目,其他对象可以控制:n个生产泵(0,最大8),n个分配泵(0,最大8)。 />
主题是酿酒。

每个子对象(生产泵或分配泵)也都有EFSM。



我尝试了什么:



我只看到了1台EFSM机器使用开关和枚举状态的情况。一个状态图函数。当计时器超过时,还有一个计时器类来执行操作。

如何使用多个EFSM解决该问题?使用线程?



我正在考虑c ++组合,但我无法想象超过1个EFSM的问题。



在此先感谢

Francesco(意大利)

Hi there, i have a c++ embedded system project with a main EFSM (PCOXS Central pumps) with other objects to control: n production pumps (0, max 8), n distribution pumps (0, max 8).
The topic is oenology.
Each sub object (production pump or distribution pump) has an EFSM too.

What I have tried:

I saw only the case with 1 EFSM machine using switch and enum states. One state graph function. There is also a timer class to perform action when the timer isOver.
How can i solve that problem with multiple EFSM ? Using threads ?

I'm thinking about c++ composition but i can't imagine the problem with more than 1 EFSM.

Thanks in advance
Francesco (Italy)

推荐答案

首先,您将获得EFSM的多个实例。您可以通过数组中的结构或类对象来解决这个问题。



我认为线程是最清晰的方式,但你可能需要一些同步。另一种方法是编写一个带有及时排序操作的queque,这样你就可以知道哪个对象可以完成哪个操作。



一个大问题是时间容差或差异在被叫行动及其实时行为中。
At first you get multiple instances of the EFSM. You may solve that via structs or class objects in an array.

I think threads would be the clearest way, but you may need some syncronization. Another way is to write a queque with timely sorted actions, so you know which action on which object can be done.

A big issue will be the time tolerances or differences in called action and their real time behavior.


这篇关于扩展的有限状态机问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆