My team and I are working on trying to extend the Pulse Engine to simulate an ECMO machine on a web server, while doing so, we are unsure about how to get Pulse Engine simulate in real time and how to get the actions to work interactively in real time as well while the engine is running on a terminal.
Any help and guidance would be deeply appreciated.
We are currently working on a scalable and dynamic multithreaded engine pool / management system, which would probably be exactly what you want. (when complete, I don’t have a timeline on when this would be ready yet). Currently this is not dynamic and not real time locked.
Basically, you need to manage (provide actions and pull data for your system) and advance time in each engine in some kind of threaded application. You would want to sleep the thread to maintain real time.
Take a look at the engine pool example. If you would like to take a shot, I can help review updates to help expedite this functionality.
You can run any of these how to examples on the terminal
I have a question about implementing the thread wrapping for a single pulse engine. Based of the Pulse Explorer, I am quite puzzled as to how to implement what’s been coded into the engine code repository. Would the “Controller.h” file be a good starting place?
You can pull data from pulse after every time step. Just access the system via something like pulse->GetCardiovascular()->GetMeanArterialPressure(PressureUnit::mmHg) and it will give you a double value. Collect all the doubles you want into an array and stash it in your database. Something like that… It depends on your databases and what you want to do with the data.