This is the implementation of the PhysiologyEngine interface for the this engines. More...
#include <Engine.h>
Inherits PhysiologyEngine.
Public Member Functions | |
PulseEngine (Logger *logger=nullptr) | |
virtual | ~PulseEngine () |
virtual bool | SerializeFromFile (const std::string &file) override |
Reset engine and set it to the state in the provided file. The file may contain json or binary. Anything but an extension of .json will be interpreted as binary. Return value indicates engine was able to load provided state file. Engine will be in a cleared state if this method fails. More... | |
virtual bool | SerializeToFile (const std::string &file) const override |
Save the current state of the engine to provided filename. Using a .json extension will save a json/ascii file. Anything else will save as binary. More... | |
virtual bool | SerializeFromString (const std::string &state, SerializationFormat m) override |
Reset engine and set it to the state in the provided string. The string can contain JSON or binary. Note that a string of bytes are binary, not text; we only use the string class as a convenient container. Return value indicates engine was able to load provided state file. Engine will be in a cleared state if this method fails. More... | |
virtual bool | SerializeToString (std::string &state, SerializationFormat m) const override |
Save the current state of the engine. The state can be saved as JSON or bytes in the given string. Note that the bytes are binary, not text; we only use the string class as a convenient container. More... | |
virtual bool | InitializeEngine (const std::string &patient_configuration, SerializationFormat m) override |
Initialize an engine based on the engines initialization structure. More... | |
virtual bool | InitializeEngine (const SEPatientConfiguration &patient_configuration) override |
This will create an engine that you can send instructions (patient,actions,conditions) to dynamically. The return value will indicate success failure of the creation of the engine. Some combinations of patients and conditions may prevent the engine from stabilizing. More... | |
virtual bool | SetConfigurationOverride (const SEEngineConfiguration *config) override |
Engines can have a configuration for allowing a user to set certain internal parameters Engines with configurations will have all configuration parameters defaulted, This allow you to change one or more or those parameters. The parameters provided will be applied during SerializeFrom* and InitializeEngine methods. Use with caution! (Use nullptr to revert back to using all engine defaults) More... | |
virtual const SEConditionManager & | GetConditionManager () const override |
Get the Condition Manager. Allows a user to check the state of active conditions. More... | |
virtual Logger * | GetLogger () const override |
Retrieve the Logger associated with this engine. More... | |
virtual SEEngineTracker * | GetEngineTracker () const override |
Retrieve the SEEngineTracker associated with tracking data from this engine to a file The SEEngineTracker is a class set up to pull data requested from the engine (via SEDataRequest's) and provide access to the data easily (ex. to easily write data to csv files) More... | |
virtual const SEEngineConfiguration * | GetConfiguration () const override |
returns the engine configuration. More... | |
virtual double | GetTimeStep (const TimeUnit &unit) const override |
returns the engine time step that is used when advancing time. More... | |
virtual double | GetSimulationTime (const TimeUnit &unit) const override |
returns the current time of the simulation. More... | |
virtual void | SetSimulationTime (const SEScalarTime &time) override |
Set the current time of the simulation. Engine Simulation time will be advanced from this time point. More... | |
virtual void | AdvanceModelTime () override |
executes one pass through the time loop of the engine at the fixed timestep More... | |
virtual void | AdvanceModelTime (double time, const TimeUnit &unit) override |
executes time loop of the engine beginning at the current time and running for the duration specified in the call at the fixed timestep More... | |
virtual bool | ProcessAction (const SEAction &action) override |
Execute the provided action. true will be returned if the engine supports the action false will be returned if the engine does not support the action. More... | |
virtual const SEActionManager & | GetActionManager () const override |
Get the Action Manager. Allows a user to check the state of active actions. More... | |
virtual const SESubstanceManager & | GetSubstanceManager () const override |
Retrieves the associated substance manager. More... | |
virtual void | SetAdvanceHandler (SEAdvanceHandler *handler) override |
Add a callback object that will be called after each timestep. More... | |
virtual const SEPatient & | GetPatient () const override |
Returns the patient object used by the engine. More... | |
virtual const SEPatient & | GetInitialPatient () const override |
Returns the initial simulation patient object used by the engine. More... | |
virtual bool | GetPatientAssessment (SEPatientAssessment &assessment) const override |
Determines the assessment type and fills the data object with current data. More... | |
virtual const SEEnvironment * | GetEnvironment () const override |
Returns the environment object used by the engine. More... | |
virtual const SEBloodChemistrySystem * | GetBloodChemistrySystem () const override |
Returns the current state of the Blood Chemistry System. More... | |
virtual const SECardiovascularSystem * | GetCardiovascularSystem () const override |
Returns the current state of the Cardiovascular System. More... | |
virtual const SEDrugSystem * | GetDrugSystem () const override |
Returns the current state of the drug system. More... | |
virtual const SEEndocrineSystem * | GetEndocrineSystem () const override |
Returns the current state of the Endocrine System. More... | |
virtual const SEEnergySystem * | GetEnergySystem () const override |
Returns the current state of the Energy System. More... | |
virtual const SEGastrointestinalSystem * | GetGastrointestinalSystem () const override |
Returns the current state of the Gastrointestinal System. More... | |
virtual const SEHepaticSystem * | GetHepaticSystem () const override |
Returns the current state of the Hepatic System. More... | |
virtual const SENervousSystem * | GetNervousSystem () const override |
Returns the current state of the Nervous System. More... | |
virtual const SERenalSystem * | GetRenalSystem () const override |
Returns the current state of the Renal System. More... | |
virtual const SERespiratorySystem * | GetRespiratorySystem () const override |
Returns the current state of the Respiratory System. More... | |
virtual const SETissueSystem * | GetTissueSystem () const override |
Returns the current state of the tissue system. More... | |
virtual const SEAnesthesiaMachine * | GetAnesthesiaMachine () const override |
Returns the current state of the Anesthesia machine. More... | |
virtual const SEElectroCardioGram * | GetElectroCardioGram () const override |
Returns the current state of the Electrocardiogram machine. More... | |
virtual const SEInhaler * | GetInhaler () const override |
Returns the current state of the Inhaler. More... | |
virtual const SEMechanicalVentilator * | GetMechanicalVentilator () const override |
Returns the current state of the Mechanical ventilator. More... | |
virtual const SECompartmentManager & | GetCompartments () const override |
Retrieves the engine compartments, providing such data as: flows, pressure, volume as well as substance volumes and volume fractions. More... | |
virtual const SEEventManager & | GetEventManager () const override |
Retrieves the associated event manager. More... | |
PulseController * | GetController () |
![]() | |
virtual | ~PhysiologyEngine () |
Protected Attributes | |
PulseController * | m_PulseController |
Detailed Description
This is the implementation of the PhysiologyEngine interface for the this engines.
It contains the necessary execution calls, patient customization calls, insult and intervention calls as well as assessment calls for obtaining the results. During engine execution a log files is generated containing information, warning and error data.
Constructor & Destructor Documentation
◆ PulseEngine()
PulseEngine::PulseEngine | ( | Logger * | logger = nullptr | ) |
◆ ~PulseEngine()
|
virtual |
Member Function Documentation
◆ AdvanceModelTime() [1/2]
|
overridevirtual |
executes one pass through the time loop of the engine at the fixed timestep
Events, errors, and warning as are logged to file not errors are returned through the API at this time.
Implements PhysiologyEngine.
◆ AdvanceModelTime() [2/2]
|
overridevirtual |
executes time loop of the engine beginning at the current time and running for the duration specified in the call at the fixed timestep
Events, errors, and warning as are logged to file not errors are returned through the API at this time.
Implements PhysiologyEngine.
◆ GetActionManager()
|
overridevirtual |
Get the Action Manager. Allows a user to check the state of active actions.
Implements PhysiologyEngine.
◆ GetAnesthesiaMachine()
|
overridevirtual |
Returns the current state of the Anesthesia machine.
Implements PhysiologyEngine.
◆ GetBloodChemistrySystem()
|
overridevirtual |
Returns the current state of the Blood Chemistry System.
Implements PhysiologyEngine.
◆ GetCardiovascularSystem()
|
overridevirtual |
Returns the current state of the Cardiovascular System.
Implements PhysiologyEngine.
◆ GetCompartments()
|
overridevirtual |
Retrieves the engine compartments, providing such data as: flows, pressure, volume as well as substance volumes and volume fractions.
Implements PhysiologyEngine.
◆ GetConditionManager()
|
overridevirtual |
Get the Condition Manager. Allows a user to check the state of active conditions.
Implements PhysiologyEngine.
◆ GetConfiguration()
|
overridevirtual |
returns the engine configuration.
Implements PhysiologyEngine.
◆ GetController()
|
inline |
◆ GetDrugSystem()
|
overridevirtual |
Returns the current state of the drug system.
Implements PhysiologyEngine.
◆ GetElectroCardioGram()
|
overridevirtual |
Returns the current state of the Electrocardiogram machine.
Implements PhysiologyEngine.
◆ GetEndocrineSystem()
|
overridevirtual |
Returns the current state of the Endocrine System.
Implements PhysiologyEngine.
◆ GetEnergySystem()
|
overridevirtual |
Returns the current state of the Energy System.
Implements PhysiologyEngine.
◆ GetEngineTracker()
|
overridevirtual |
Retrieve the SEEngineTracker associated with tracking data from this engine to a file The SEEngineTracker is a class set up to pull data requested from the engine (via SEDataRequest's) and provide access to the data easily (ex. to easily write data to csv files)
Implements PhysiologyEngine.
◆ GetEnvironment()
|
overridevirtual |
Returns the environment object used by the engine.
Implements PhysiologyEngine.
◆ GetEventManager()
|
overridevirtual |
Retrieves the associated event manager.
Implements PhysiologyEngine.
◆ GetGastrointestinalSystem()
|
overridevirtual |
Returns the current state of the Gastrointestinal System.
Implements PhysiologyEngine.
◆ GetHepaticSystem()
|
overridevirtual |
Returns the current state of the Hepatic System.
Implements PhysiologyEngine.
◆ GetInhaler()
|
overridevirtual |
Returns the current state of the Inhaler.
Implements PhysiologyEngine.
◆ GetInitialPatient()
|
overridevirtual |
Returns the initial simulation patient object used by the engine.
Implements PhysiologyEngine.
◆ GetLogger()
|
overridevirtual |
Retrieve the Logger associated with this engine.
Implements PhysiologyEngine.
◆ GetMechanicalVentilator()
|
overridevirtual |
Returns the current state of the Mechanical ventilator.
Implements PhysiologyEngine.
◆ GetNervousSystem()
|
overridevirtual |
Returns the current state of the Nervous System.
Implements PhysiologyEngine.
◆ GetPatient()
|
overridevirtual |
Returns the patient object used by the engine.
Implements PhysiologyEngine.
◆ GetPatientAssessment()
|
overridevirtual |
Determines the assessment type and fills the data object with current data.
Assessments can be queried at any point in the calculation and as many times are desired.
Implements PhysiologyEngine.
◆ GetRenalSystem()
|
overridevirtual |
Returns the current state of the Renal System.
Implements PhysiologyEngine.
◆ GetRespiratorySystem()
|
overridevirtual |
Returns the current state of the Respiratory System.
Implements PhysiologyEngine.
◆ GetSimulationTime()
|
overridevirtual |
returns the current time of the simulation.
Implements PhysiologyEngine.
◆ GetSubstanceManager()
|
overridevirtual |
Retrieves the associated substance manager.
Implements PhysiologyEngine.
◆ GetTimeStep()
|
overridevirtual |
returns the engine time step that is used when advancing time.
Implements PhysiologyEngine.
◆ GetTissueSystem()
|
overridevirtual |
Returns the current state of the tissue system.
Implements PhysiologyEngine.
◆ InitializeEngine() [1/2]
|
overridevirtual |
Initialize an engine based on the engines initialization structure.
An initialization structure is up to every engine. It should have a SEPatientConfiguration (or derivative) But it may also have more stuctures associated with it, it's up to the engine.
Implements PhysiologyEngine.
◆ InitializeEngine() [2/2]
|
overridevirtual |
This will create an engine that you can send instructions (patient,actions,conditions) to dynamically. The return value will indicate success failure of the creation of the engine. Some combinations of patients and conditions may prevent the engine from stabilizing.
Implements PhysiologyEngine.
◆ ProcessAction()
|
overridevirtual |
Execute the provided action. true will be returned if the engine supports the action false will be returned if the engine does not support the action.
Implements PhysiologyEngine.
◆ SerializeFromFile()
|
overridevirtual |
Reset engine and set it to the state in the provided file. The file may contain json or binary. Anything but an extension of .json will be interpreted as binary. Return value indicates engine was able to load provided state file. Engine will be in a cleared state if this method fails.
Implements PhysiologyEngine.
◆ SerializeFromString()
|
overridevirtual |
Reset engine and set it to the state in the provided string. The string can contain JSON or binary. Note that a string of bytes are binary, not text; we only use the string class as a convenient container. Return value indicates engine was able to load provided state file. Engine will be in a cleared state if this method fails.
Implements PhysiologyEngine.
◆ SerializeToFile()
|
overridevirtual |
Save the current state of the engine to provided filename. Using a .json extension will save a json/ascii file. Anything else will save as binary.
Implements PhysiologyEngine.
◆ SerializeToString()
|
overridevirtual |
Save the current state of the engine. The state can be saved as JSON or bytes in the given string. Note that the bytes are binary, not text; we only use the string class as a convenient container.
Implements PhysiologyEngine.
◆ SetAdvanceHandler()
|
overridevirtual |
Add a callback object that will be called after each timestep.
Implements PhysiologyEngine.
◆ SetConfigurationOverride()
|
overridevirtual |
Engines can have a configuration for allowing a user to set certain internal parameters Engines with configurations will have all configuration parameters defaulted, This allow you to change one or more or those parameters. The parameters provided will be applied during SerializeFrom* and InitializeEngine methods. Use with caution! (Use nullptr to revert back to using all engine defaults)
Implements PhysiologyEngine.
◆ SetSimulationTime()
|
overridevirtual |
Set the current time of the simulation. Engine Simulation time will be advanced from this time point.
Implements PhysiologyEngine.
Member Data Documentation
◆ m_PulseController
|
protected |