PhysiologyEngine Class Referenceabstract

#include <PhysiologyEngine.h>

Inherits Loggable.

Public Member Functions

 PhysiologyEngine (Logger *logger=nullptr)
 
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, eSerializationFormat 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, eSerializationFormat 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, eSerializationFormat 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 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 bool AdvanceModelTime ()=0
 executes one pass through the time loop of the engine at the fixed timestep More...
 
virtual bool 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 SEBagValveMaskGetBagValveMask () const =0
 Returns the current state of the Bag Valve Mask. 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...
 
virtual SEBlackBoxManagerGetBlackBoxes () const =0
 Retrieves the engine black box manager Black boxes allow users to inject or retrieve flows, pressure, volume as well as substance volumes and volume fractions into the engine, use with caution. These are intended to allow integration between Pulse and other systems at a low level. More...
 
- Public Member Functions inherited from Loggable
 Loggable (Logger *logger=nullptr)
 
 Loggable (std::string const &logfile)
 
virtual ~Loggable ()
 
virtual LoggerGetLogger () const
 
virtual void SetLogger (Logger &logger)
 
virtual void Debug (std::string const &msg, std::string const &origin=empty) const
 
virtual void Debug (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Debug (std::ostream &msg, std::string const &origin=empty) const
 
virtual void Info (std::string const &msg, std::string const &origin=empty) const
 
virtual void Info (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Info (const std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Info (std::ostream &msg, std::string const &origin=empty) const
 
virtual void Warning (std::string const &msg, std::string const &origin=empty) const
 
virtual void Warning (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Warning (std::ostream &msg, std::string const &origin=empty) const
 
virtual void Error (std::string const &msg, std::string const &origin=empty) const
 
virtual void Error (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Error (std::ostream &msg, std::string const &origin=empty) const
 
virtual void Fatal (std::string const &msg, std::string const &origin=empty) const
 
virtual void Fatal (std::stringstream &msg, std::string const &origin=empty) const
 
virtual void Fatal (std::ostream &msg, std::string const &origin=empty) const
 

Additional Inherited Members

- Static Public Attributes inherited from Loggable
static const std::string empty
 
- Protected Attributes inherited from Loggable
bool myLogger
 
Loggerm_Logger
 

Constructor & Destructor Documentation

◆ PhysiologyEngine()

PhysiologyEngine::PhysiologyEngine ( Logger logger = nullptr)
inline

◆ ~PhysiologyEngine()

virtual PhysiologyEngine::~PhysiologyEngine ( )
inlinevirtual

Member Function Documentation

◆ AdvanceModelTime() [1/2]

virtual bool 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.

◆ AdvanceModelTime() [2/2]

virtual bool 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.

◆ GetActionManager()

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

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

◆ GetAnesthesiaMachine()

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

Returns the current state of the Anesthesia machine.

◆ GetBagValveMask()

virtual const SEBagValveMask* PhysiologyEngine::GetBagValveMask ( ) const
pure virtual

Returns the current state of the Bag Valve Mask.

◆ GetBlackBoxes()

virtual SEBlackBoxManager& PhysiologyEngine::GetBlackBoxes ( ) const
pure virtual

Retrieves the engine black box manager Black boxes allow users to inject or retrieve flows, pressure, volume as well as substance volumes and volume fractions into the engine, use with caution. These are intended to allow integration between Pulse and other systems at a low level.

◆ GetBloodChemistrySystem()

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

Returns the current state of the Blood Chemistry System.

◆ GetCardiovascularSystem()

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

Returns the current state of the Cardiovascular System.

◆ 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.

◆ GetConditionManager()

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

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

◆ GetConfiguration()

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

returns the engine configuration.

◆ GetDrugSystem()

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

Returns the current state of the drug system.

◆ GetElectroCardioGram()

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

Returns the current state of the Electrocardiogram machine.

◆ GetEndocrineSystem()

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

Returns the current state of the Endocrine System.

◆ GetEnergySystem()

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

Returns the current state of the Energy System.

◆ 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)

◆ GetEnvironment()

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

Returns the environment object used by the engine.

◆ GetEventManager()

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

Retrieves the associated event manager.

◆ GetGastrointestinalSystem()

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

Returns the current state of the Gastrointestinal System.

◆ GetHepaticSystem()

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

Returns the current state of the Hepatic System.

◆ GetInhaler()

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

Returns the current state of the Inhaler.

◆ GetInitialPatient()

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

Returns the initial simulation patient object used by the engine.

◆ GetMechanicalVentilator()

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

Returns the current state of the Mechanical ventilator.

◆ GetNervousSystem()

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

Returns the current state of the Nervous System.

◆ GetPatient()

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

Returns the patient object used by the engine.

◆ 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.

◆ GetRenalSystem()

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

Returns the current state of the Renal System.

◆ GetRespiratorySystem()

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

Returns the current state of the Respiratory System.

◆ GetSimulationTime()

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

returns the current time of the simulation.

◆ GetSubstanceManager()

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

Retrieves the associated substance manager.

◆ GetTimeStep()

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

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

◆ GetTissueSystem()

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

Returns the current state of the tissue system.

◆ InitializeEngine() [1/2]

virtual bool PhysiologyEngine::InitializeEngine ( const std::string &  patient_configuration,
eSerializationFormat  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.

◆ 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.

◆ 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.

◆ 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.

◆ SerializeFromString()

virtual bool PhysiologyEngine::SerializeFromString ( const std::string &  state,
eSerializationFormat  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.

◆ 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.

◆ SerializeToString()

virtual bool PhysiologyEngine::SerializeToString ( std::string &  state,
eSerializationFormat  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.

◆ SetAdvanceHandler()

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

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

◆ 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)

◆ 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.

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.