Pulse adds COVID-19 Simulation Support
×
PhysiologyEngine Class Referenceabstract

#include <PhysiologyEngine.h>

Inherited by PulseEngine.

Public Member Functions

virtual ~PhysiologyEngine ()
 
virtual bool SerializeFromFile (const std::string &file)=0
 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 &filename) const =0
 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)=0
 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 =0
 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)=0
 Initialize an engine based on the engines initialization structure. More...
 
virtual bool InitializeEngine (const SEPatientConfiguration &patient_configuration)=0
 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 const SEConditionManagerGetConditionManager () const =0
 Get the Condition Manager. Allows a user to check the state of active conditions. More...
 
virtual bool SetConfigurationOverride (const SEEngineConfiguration *config)=0
 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 SEEngineConfigurationGetConfiguration () const =0
 returns the engine configuration. More...
 
virtual LoggerGetLogger () const =0
 Retrieve the Logger associated with this engine. More...
 
virtual SEEngineTrackerGetEngineTracker () const =0
 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 double GetTimeStep (const TimeUnit &unit) const =0
 returns the engine time step that is used when advancing time. More...
 
virtual double GetSimulationTime (const TimeUnit &unit) const =0
 returns the current time of the simulation. More...
 
virtual void SetSimulationTime (const SEScalarTime &time)=0
 Set the current time of the simulation. Engine Simulation time will be advanced from this time point. More...
 
virtual void AdvanceModelTime ()=0
 executes one pass through the time loop of the engine at the fixed timestep More...
 
virtual void AdvanceModelTime (double time, const TimeUnit &unit)=0
 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 void SetAdvanceHandler (SEAdvanceHandler *handler)=0
 Add a callback object that will be called after each timestep. More...
 
virtual bool ProcessAction (const SEAction &action)=0
 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 SEActionManagerGetActionManager () const =0
 Get the Action Manager. Allows a user to check the state of active actions. More...
 
virtual const SESubstanceManagerGetSubstanceManager () const =0
 Retrieves the associated substance manager. More...
 
virtual const SEEventManagerGetEventManager () const =0
 Retrieves the associated event manager. More...
 
virtual const SEPatientGetPatient () const =0
 Returns the patient object used by the engine. More...
 
virtual const SEPatientGetInitialPatient () const =0
 Returns the initial simulation patient object used by the engine. More...
 
virtual bool GetPatientAssessment (SEPatientAssessment &assessment) const =0
 Determines the assessment type and fills the data object with current data. More...
 
virtual const SEEnvironmentGetEnvironment () const =0
 Returns the environment object used by the engine. More...
 
virtual const SEBloodChemistrySystemGetBloodChemistrySystem () const =0
 Returns the current state of the Blood Chemistry System. More...
 
virtual const SECardiovascularSystemGetCardiovascularSystem () const =0
 Returns the current state of the Cardiovascular System. More...
 
virtual const SEDrugSystemGetDrugSystem () const =0
 Returns the current state of the drug system. More...
 
virtual const SEEndocrineSystemGetEndocrineSystem () const =0
 Returns the current state of the Endocrine System. More...
 
virtual const SEEnergySystemGetEnergySystem () const =0
 Returns the current state of the Energy System. More...
 
virtual const SEGastrointestinalSystemGetGastrointestinalSystem () const =0
 Returns the current state of the Gastrointestinal System. More...
 
virtual const SEHepaticSystemGetHepaticSystem () const =0
 Returns the current state of the Hepatic System. More...
 
virtual const SENervousSystemGetNervousSystem () const =0
 Returns the current state of the Nervous System. More...
 
virtual const SERenalSystemGetRenalSystem () const =0
 Returns the current state of the Renal System. More...
 
virtual const SERespiratorySystemGetRespiratorySystem () const =0
 Returns the current state of the Respiratory System. More...
 
virtual const SETissueSystemGetTissueSystem () const =0
 Returns the current state of the tissue system. More...
 
virtual const SEAnesthesiaMachineGetAnesthesiaMachine () const =0
 Returns the current state of the Anesthesia machine. More...
 
virtual const SEElectroCardioGramGetElectroCardioGram () const =0
 Returns the current state of the Electrocardiogram machine. More...
 
virtual const SEInhalerGetInhaler () const =0
 Returns the current state of the Inhaler. More...
 
virtual const SEMechanicalVentilatorGetMechanicalVentilator () const =0
 Returns the current state of the Mechanical ventilator. More...
 
virtual const SECompartmentManagerGetCompartments () const =0
 Retrieves the engine compartments, providing such data as: flows, pressure, volume as well as substance volumes and volume fractions. More...
 

Constructor & Destructor Documentation

◆ ~PhysiologyEngine()

virtual PhysiologyEngine::~PhysiologyEngine ( )
inlinevirtual

Member Function Documentation

◆ AdvanceModelTime() [1/2]

virtual void PhysiologyEngine::AdvanceModelTime ( )
pure virtual

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.

Implemented in PulseEngine.

◆ AdvanceModelTime() [2/2]

virtual void PhysiologyEngine::AdvanceModelTime ( double  time,
const TimeUnit unit 
)
pure virtual

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.

Implemented in PulseEngine.

◆ GetActionManager()

virtual const SEActionManager& PhysiologyEngine::GetActionManager ( ) const
pure virtual

Get the Action Manager. Allows a user to check the state of active actions.

Implemented in PulseEngine.

◆ GetAnesthesiaMachine()

virtual const SEAnesthesiaMachine* PhysiologyEngine::GetAnesthesiaMachine ( ) const
pure virtual

Returns the current state of the Anesthesia machine.

Implemented in PulseEngine.

◆ GetBloodChemistrySystem()

virtual const SEBloodChemistrySystem* PhysiologyEngine::GetBloodChemistrySystem ( ) const
pure virtual

Returns the current state of the Blood Chemistry System.

Implemented in PulseEngine.

◆ GetCardiovascularSystem()

virtual const SECardiovascularSystem* PhysiologyEngine::GetCardiovascularSystem ( ) const
pure virtual

Returns the current state of the Cardiovascular System.

Implemented in PulseEngine.

◆ GetCompartments()

virtual const SECompartmentManager& PhysiologyEngine::GetCompartments ( ) const
pure virtual

Retrieves the engine compartments, providing such data as: flows, pressure, volume as well as substance volumes and volume fractions.

Implemented in PulseEngine.

◆ GetConditionManager()

virtual const SEConditionManager& PhysiologyEngine::GetConditionManager ( ) const
pure virtual

Get the Condition Manager. Allows a user to check the state of active conditions.

Implemented in PulseEngine.

◆ GetConfiguration()

virtual const SEEngineConfiguration* PhysiologyEngine::GetConfiguration ( ) const
pure virtual

returns the engine configuration.

Implemented in PulseEngine.

◆ GetDrugSystem()

virtual const SEDrugSystem* PhysiologyEngine::GetDrugSystem ( ) const
pure virtual

Returns the current state of the drug system.

Implemented in PulseEngine.

◆ GetElectroCardioGram()

virtual const SEElectroCardioGram* PhysiologyEngine::GetElectroCardioGram ( ) const
pure virtual

Returns the current state of the Electrocardiogram machine.

Implemented in PulseEngine.

◆ GetEndocrineSystem()

virtual const SEEndocrineSystem* PhysiologyEngine::GetEndocrineSystem ( ) const
pure virtual

Returns the current state of the Endocrine System.

Implemented in PulseEngine.

◆ GetEnergySystem()

virtual const SEEnergySystem* PhysiologyEngine::GetEnergySystem ( ) const
pure virtual

Returns the current state of the Energy System.

Implemented in PulseEngine.

◆ GetEngineTracker()

virtual SEEngineTracker* PhysiologyEngine::GetEngineTracker ( ) const
pure virtual

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)

Implemented in PulseEngine.

◆ GetEnvironment()

virtual const SEEnvironment* PhysiologyEngine::GetEnvironment ( ) const
pure virtual

Returns the environment object used by the engine.

Implemented in PulseEngine.

◆ GetEventManager()

virtual const SEEventManager& PhysiologyEngine::GetEventManager ( ) const
pure virtual

Retrieves the associated event manager.

Implemented in PulseEngine.

◆ GetGastrointestinalSystem()

virtual const SEGastrointestinalSystem* PhysiologyEngine::GetGastrointestinalSystem ( ) const
pure virtual

Returns the current state of the Gastrointestinal System.

Implemented in PulseEngine.

◆ GetHepaticSystem()

virtual const SEHepaticSystem* PhysiologyEngine::GetHepaticSystem ( ) const
pure virtual

Returns the current state of the Hepatic System.

Implemented in PulseEngine.

◆ GetInhaler()

virtual const SEInhaler* PhysiologyEngine::GetInhaler ( ) const
pure virtual

Returns the current state of the Inhaler.

Implemented in PulseEngine.

◆ GetInitialPatient()

virtual const SEPatient& PhysiologyEngine::GetInitialPatient ( ) const
pure virtual

Returns the initial simulation patient object used by the engine.

Implemented in PulseEngine.

◆ GetLogger()

virtual Logger* PhysiologyEngine::GetLogger ( ) const
pure virtual

Retrieve the Logger associated with this engine.

Implemented in PulseEngine.

◆ GetMechanicalVentilator()

virtual const SEMechanicalVentilator* PhysiologyEngine::GetMechanicalVentilator ( ) const
pure virtual

Returns the current state of the Mechanical ventilator.

Implemented in PulseEngine.

◆ GetNervousSystem()

virtual const SENervousSystem* PhysiologyEngine::GetNervousSystem ( ) const
pure virtual

Returns the current state of the Nervous System.

Implemented in PulseEngine.

◆ GetPatient()

virtual const SEPatient& PhysiologyEngine::GetPatient ( ) const
pure virtual

Returns the patient object used by the engine.

Implemented in PulseEngine.

◆ GetPatientAssessment()

virtual bool PhysiologyEngine::GetPatientAssessment ( SEPatientAssessment assessment) const
pure virtual

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.

Implemented in PulseEngine.

◆ GetRenalSystem()

virtual const SERenalSystem* PhysiologyEngine::GetRenalSystem ( ) const
pure virtual

Returns the current state of the Renal System.

Implemented in PulseEngine.

◆ GetRespiratorySystem()

virtual const SERespiratorySystem* PhysiologyEngine::GetRespiratorySystem ( ) const
pure virtual

Returns the current state of the Respiratory System.

Implemented in PulseEngine.

◆ GetSimulationTime()

virtual double PhysiologyEngine::GetSimulationTime ( const TimeUnit unit) const
pure virtual

returns the current time of the simulation.

Implemented in PulseEngine.

◆ GetSubstanceManager()

virtual const SESubstanceManager& PhysiologyEngine::GetSubstanceManager ( ) const
pure virtual

Retrieves the associated substance manager.

Implemented in PulseEngine.

◆ GetTimeStep()

virtual double PhysiologyEngine::GetTimeStep ( const TimeUnit unit) const
pure virtual

returns the engine time step that is used when advancing time.

Implemented in PulseEngine.

◆ GetTissueSystem()

virtual const SETissueSystem* PhysiologyEngine::GetTissueSystem ( ) const
pure virtual

Returns the current state of the tissue system.

Implemented in PulseEngine.

◆ InitializeEngine() [1/2]

virtual bool PhysiologyEngine::InitializeEngine ( const std::string &  patient_configuration,
SerializationFormat  m 
)
pure virtual

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.

Implemented in PulseEngine.

◆ InitializeEngine() [2/2]

virtual bool PhysiologyEngine::InitializeEngine ( const SEPatientConfiguration patient_configuration)
pure virtual

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.

Implemented in PulseEngine.

◆ ProcessAction()

virtual bool PhysiologyEngine::ProcessAction ( const SEAction action)
pure virtual

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.

Implemented in PulseEngine.

◆ SerializeFromFile()

virtual bool PhysiologyEngine::SerializeFromFile ( const std::string &  file)
pure virtual

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.

Implemented in PulseEngine.

◆ SerializeFromString()

virtual bool PhysiologyEngine::SerializeFromString ( const std::string &  state,
SerializationFormat  m 
)
pure virtual

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.

Implemented in PulseEngine.

◆ SerializeToFile()

virtual bool PhysiologyEngine::SerializeToFile ( const std::string &  filename) const
pure virtual

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.

Implemented in PulseEngine.

◆ SerializeToString()

virtual bool PhysiologyEngine::SerializeToString ( std::string &  state,
SerializationFormat  m 
) const
pure virtual

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.

Implemented in PulseEngine.

◆ SetAdvanceHandler()

virtual void PhysiologyEngine::SetAdvanceHandler ( SEAdvanceHandler handler)
pure virtual

Add a callback object that will be called after each timestep.

Implemented in PulseEngine.

◆ SetConfigurationOverride()

virtual bool PhysiologyEngine::SetConfigurationOverride ( const SEEngineConfiguration config)
pure virtual

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)

Implemented in PulseEngine.

◆ SetSimulationTime()

virtual void PhysiologyEngine::SetSimulationTime ( const SEScalarTime time)
pure virtual

Set the current time of the simulation. Engine Simulation time will be advanced from this time point.

Implemented in PulseEngine.

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.