This is the implementation of the PhysiologyEngine interface for the biogears engines. More...
#include <BioGearsEngine.h>

Public Member Functions | |
BioGearsEngine (Logger *logger) | |
BioGearsEngine (const std::string &logFileName) | |
BioGearsEngine (const char *logFileName) | |
BioGearsEngine (Logger *logger, const std::string &working_dir) | |
BioGearsEngine (Logger *logger, const char *working_dir) | |
BioGearsEngine (const std::string &, const std::string &working_dir) | |
BioGearsEngine (const char *, const char *) | |
virtual | ~BioGearsEngine () override |
virtual bool | LoadState (const char *file, const SEScalarTime *simTime=nullptr) override |
Reset engine and set it to the state in the provided file. You may provided a Simulation Time to be used if desired. It will be reflected in the GetSimulationTime method. 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 | LoadState (const std::string &file, const SEScalarTime *simTime=nullptr) override |
virtual bool | LoadState (const CDM::PhysiologyEngineStateData &state, const SEScalarTime *simTime=nullptr) override |
Reset engine and set it to the state in the provided file. You may provided a Simulation Time to be used if desired. It will be reflected in the GetSimulationTime method. Return value indicates engine was able to load provided state file. Engine will be in a cleared state if this method fails.More... | |
virtual std::unique_ptr< CDM::PhysiologyEngineStateData > | SaveState (const char *file) override |
Save the current state of the engine. State will be written to a file if provided. State object will be returned. Engine will be in a cleared state if this method fails.More... | |
virtual std::unique_ptr< CDM::PhysiologyEngineStateData > | SaveState (const std::string &file="") override |
virtual Logger * | GetLogger () override |
Retrieve the Logger associated with this engineMore... | |
virtual PhysiologyEngineTrack * | GetEngineTrack () override |
Retrieve the PhysiologyEngineTrack associated with tracking data from this engine to a fileMore... | |
virtual bool | InitializeEngine (const char *patientFile, const std::vector< const SECondition * > *conditions=nullptr, const PhysiologyEngineConfiguration *config=nullptr) override |
locates the xml patient file and reads in the values. More... | |
virtual bool | InitializeEngine (const std::string &patientFile, const std::vector< const SECondition * > *conditions=nullptr, const PhysiologyEngineConfiguration *config=nullptr) override |
virtual bool | InitializeEngine (const SEPatient &patient, const std::vector< const SECondition * > *conditions=nullptr, const PhysiologyEngineConfiguration *config=nullptr) 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 const PhysiologyEngineConfiguration * | GetConfiguration () override |
returns the engine configuration.More... | |
virtual double | GetTimeStep (const TimeUnit &unit) override |
returns the engine time step that is used when advancing time. More... | |
virtual double | GetSimulationTime (const TimeUnit &unit) override |
returns the current time of the simulation.More... | |
virtual void | AdvanceModelTime (bool appendDataTrack=false) override |
executes one pass through the time loop of the engine at the fixed timestep More... | |
virtual void | AdvanceModelTime (double time, const TimeUnit &unit=TimeUnit::s, bool appendDataTrack=false) 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 SESubstanceManager & | GetSubstanceManager () override |
Retrieves the associated substance manager. More... | |
virtual void | SetEventHandler (SEEventHandler *handler) override |
Add a callback object that will be called whenever a pateint or anesthesia machine event changes stateMore... | |
virtual const SEPatient & | GetPatient () override |
Returns the patient object used by the engine. More... | |
virtual bool | GetPatientAssessment (SEPatientAssessment &assessment) override |
Determines the assessment type and fills the data object with current data. More... | |
virtual const SEEnvironment * | GetEnvironment () override |
Returns the environment object used by the engine. More... | |
virtual const SEBloodChemistrySystem * | GetBloodChemistrySystem () override |
Returns the current state of the Blood Chemistry System. More... | |
virtual const SECardiovascularSystem * | GetCardiovascularSystem () override |
Returns the current state of the Cardiovascular System. More... | |
virtual const SEDrugSystem * | GetDrugSystem () override |
Returns the current state of the drug system. More... | |
virtual const SEEndocrineSystem * | GetEndocrineSystem () override |
Returns the current state of the Endocrine System. More... | |
virtual const SEEnergySystem * | GetEnergySystem () override |
Returns the current state of the Energy System. More... | |
virtual const SEGastrointestinalSystem * | GetGastrointestinalSystem () override |
Returns the current state of the Gastrointestinal System. More... | |
virtual const SEHepaticSystem * | GetHepaticSystem () override |
Returns the current state of the Hepatic System. More... | |
virtual const SENervousSystem * | GetNervousSystem () override |
Returns the current state of the Nervous System. More... | |
virtual const SERenalSystem * | GetRenalSystem () override |
Returns the current state of the Renal System. More... | |
virtual const SERespiratorySystem * | GetRespiratorySystem () override |
Returns the current state of the Respiratory System. More... | |
virtual const SETissueSystem * | GetTissueSystem () override |
Returns the current state of the tissue system. More... | |
virtual const SEAnesthesiaMachine * | GetAnesthesiaMachine () override |
Returns the current state of the Anesthesia machine. More... | |
virtual const SEElectroCardioGram * | GetElectroCardioGram () override |
Returns the current state of the Electrocardiogram machine. More... | |
virtual const SEInhaler * | GetInhaler () override |
Returns the current state of the Inhaler. More... | |
virtual const SECompartmentManager & | GetCompartments () override |
Retrieves the engine compartments, providing such data as: flows, pressure, volume as well as substance volumes and volume fractions. More... | |
virtual Tree< const char * > | GetDataRequestGraph () const override |
Return a Graph of DataRequest that the current PhysiologyEngine Supports.More... | |
virtual bool | IsAutoTracking () const override |
Returns the current state of the AutoTracking Property. True implies for each time advance All DataRequest will be tracked if the current simulation time is a multiple of GetDataRequestManager().GetSamplesPerSecond();More... | |
virtual void | SetAutoTrackFlag (bool flag) override |
Return Allows the toggling of the SetAutoTrackFlag to On/OffMore... | |
virtual bool | IsTrackingStabilization () const override |
Returns the current state of the Track Stabilization Property. When true the user expects the Results file to include engine values during stabilization routines When false the user expects the 0 time index to be the first engine readout post stabilization.More... | |
virtual void | SetTrackStabilizationFlag (bool flag) override |
This value will be overridden if TrackingStabilizationCriteria is loaded by any means After it is set. But can be used as a shortcut to modify m_Config->GetStabilizationCriteria()->TrackStabilization() After stabiliztion criteira has been loaded.More... | |
![]() | |
virtual | ~PhysiologyEngine () |
![]() | |
BioGears (Logger *logger) | |
BioGears (const std::string &logfileName) | |
BioGears (Logger *logger, const std::string &working_dir) | |
BioGears (const std::string &logfileName, const std::string &working_dir) | |
virtual | ~BioGears () |
EngineState | GetState () |
const EngineState | GetState () const |
DataTrack & | GetDataTrack () |
SaturationCalculator & | GetSaturationCalculator () |
const SaturationCalculator & | GetSaturationCalculator () const |
DiffusionCalculator & | GetDiffusionCalculator () |
const DiffusionCalculator & | GetDiffusionCalculator () const |
BioGearsSubstances & | GetSubstances () |
const BioGearsSubstances & | GetSubstances () const |
SEPatient & | GetPatient () |
const SEPatient & | GetPatient () const |
bool | GetPatientAssessment (SEPatientAssessment &assessment) |
SEBloodChemistrySystem & | GetBloodChemistry () |
SECardiovascularSystem & | GetCardiovascular () |
SEDrugSystem & | GetDrugs () |
SEEndocrineSystem & | GetEndocrine () |
SEEnergySystem & | GetEnergy () |
SEGastrointestinalSystem & | GetGastrointestinal () |
SEHepaticSystem & | GetHepatic () |
SENervousSystem & | GetNervous () |
SERenalSystem & | GetRenal () |
SERespiratorySystem & | GetRespiratory () |
SETissueSystem & | GetTissue () |
SEEnvironment & | GetEnvironment () |
SEAnesthesiaMachine & | GetAnesthesiaMachine () |
SEElectroCardioGram & | GetECG () |
SEInhaler & | GetInhaler () |
SEActionManager & | GetActions () |
SEConditionManager & | GetConditions () |
BioGearsCircuits & | GetCircuits () |
BioGearsCompartments & | GetCompartments () |
const BioGearsConfiguration & | GetConfiguration () |
const SEScalarTime & | GetEngineTime () |
const SEScalarTime & | GetSimulationTime () |
const SEScalarTime & | GetTimeStep () |
CDM::enumBioGearsAirwayMode::value | GetAirwayMode () |
CDM::enumOnOff::value | GetIntubation () |
const SEBloodChemistrySystem & | GetBloodChemistry () const |
const SECardiovascularSystem & | GetCardiovascular () const |
const SEDrugSystem & | GetDrugs () const |
const SEEndocrineSystem & | GetEndocrine () const |
const SEEnergySystem & | GetEnergy () const |
const SEGastrointestinalSystem & | GetGastrointestinal () const |
const SEHepaticSystem & | GetHepatic () const |
const SENervousSystem & | GetNervous () const |
const SERenalSystem & | GetRenal () const |
const SERespiratorySystem & | GetRespiratory () const |
const SETissueSystem & | GetTissue () const |
const SEEnvironment & | GetEnvironment () const |
const SEAnesthesiaMachine & | GetAnesthesiaMachine () const |
const SEElectroCardioGram & | GetECG () const |
const SEInhaler & | GetInhaler () const |
const SEActionManager & | GetActions () const |
const SEConditionManager & | GetConditions () const |
const BioGearsCircuits & | GetCircuits () const |
const BioGearsCompartments & | GetCompartments () const |
const BioGearsConfiguration & | GetConfiguration () const |
const SEScalarTime & | GetEngineTime () const |
const SEScalarTime & | GetSimulationTime () const |
const SEScalarTime & | GetTimeStep () const |
const CDM::enumBioGearsAirwayMode::value | GetAirwayMode () const |
const CDM::enumOnOff::value | GetIntubation () const |
bool | CreateCircuitsAndCompartments () |
void | SetIntubation (CDM::enumOnOff::value s) |
void | SetAirwayMode (CDM::enumBioGearsAirwayMode::value mode) |
Logger * | GetLogger () const |
Protected Member Functions | |
virtual bool | IsReady () |
virtual bool | InitializeEngine (const std::vector< const SECondition * > *conditions=nullptr, const PhysiologyEngineConfiguration *config=nullptr) |
![]() | |
void | SetupCardiovascular () |
void | SetupCerebral () |
void | SetupRenal () |
void | SetupTissue () |
void | SetupGastrointestinal () |
void | SetupRespiratory () |
void | SetupAnesthesiaMachine () |
void | SetupInhaler () |
void | SetupMechanicalVentilator () |
void | SetupExternalTemperature () |
void | SetupInternalTemperature () |
bool | Initialize (const PhysiologyEngineConfiguration *config) |
bool | SetupPatient () |
void | SetUp () |
virtual void | AtSteadyState (EngineState state) |
void | PreProcess () |
void | Process () |
void | PostProcess () |
void | ForwardFatal (const std::string &msg, const std::string &origin) |
Detailed Description
This is the implementation of the PhysiologyEngine interface for the biogears 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
biogears::BioGearsEngine::BioGearsEngine | ( | Logger * | logger | ) |
biogears::BioGearsEngine::BioGearsEngine | ( | const std::string & | logFileName | ) |
biogears::BioGearsEngine::BioGearsEngine | ( | const char * | logFileName | ) |
biogears::BioGearsEngine::BioGearsEngine | ( | Logger * | logger, |
const std::string & | working_dir | ||
) |
biogears::BioGearsEngine::BioGearsEngine | ( | Logger * | logger, |
const char * | working_dir | ||
) |
biogears::BioGearsEngine::BioGearsEngine | ( | const std::string & | logFileName, |
const std::string & | working_dir | ||
) |
biogears::BioGearsEngine::BioGearsEngine | ( | const char * | logFileName, |
const char * | working_dir | ||
) |
|
overridevirtual |
Member Function Documentation
|
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 biogears::PhysiologyEngine.
|
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 biogears::PhysiologyEngine.
|
overridevirtual |
Returns the current state of the Anesthesia machine.
----------------------------------------------------------------------------------------------—
Implements biogears::PhysiologyEngine.
|
overridevirtual |
Returns the current state of the Blood Chemistry System.
----------------------------------------------------------------------------------------------—
Implements biogears::PhysiologyEngine.
|
overridevirtual |
Returns the current state of the Cardiovascular System.
----------------------------------------------------------------------------------------------—
Implements biogears::PhysiologyEngine.
|
overridevirtual |
Retrieves the engine compartments, providing such data as: flows, pressure, volume as well as substance volumes and volume fractions.
----------------------------------------------------------------------------------------------—
Implements biogears::PhysiologyEngine.
|
overridevirtual |
|
overridevirtual |
Return a Graph of DataRequest that the current PhysiologyEngine Supports.
Implements biogears::PhysiologyEngine.
|
overridevirtual |
Returns the current state of the drug system.
----------------------------------------------------------------------------------------------—
Implements biogears::PhysiologyEngine.
|
overridevirtual |
Returns the current state of the Electrocardiogram machine.
----------------------------------------------------------------------------------------------—
Implements biogears::PhysiologyEngine.
|
overridevirtual |
Returns the current state of the Endocrine System.
----------------------------------------------------------------------------------------------—
Implements biogears::PhysiologyEngine.
|
overridevirtual |
Returns the current state of the Energy System.
----------------------------------------------------------------------------------------------—
Implements biogears::PhysiologyEngine.
|
overridevirtual |
Retrieve the PhysiologyEngineTrack associated with tracking data from this engine to a file
Implements biogears::PhysiologyEngine.
|
overridevirtual |
Returns the environment object used by the engine.
----------------------------------------------------------------------------------------------—
Implements biogears::PhysiologyEngine.
|
overridevirtual |
Returns the current state of the Gastrointestinal System.
----------------------------------------------------------------------------------------------—
Implements biogears::PhysiologyEngine.
|
overridevirtual |
Returns the current state of the Hepatic System.
----------------------------------------------------------------------------------------------—
Implements biogears::PhysiologyEngine.
|
overridevirtual |
Returns the current state of the Inhaler.
----------------------------------------------------------------------------------------------—
Implements biogears::PhysiologyEngine.
|
overridevirtual |
|
overridevirtual |
Returns the current state of the Nervous System.
----------------------------------------------------------------------------------------------—
Implements biogears::PhysiologyEngine.
|
overridevirtual |
Returns the patient object used by the engine.
----------------------------------------------------------------------------------------------—
Implements biogears::PhysiologyEngine.
|
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 biogears::PhysiologyEngine.
|
overridevirtual |
Returns the current state of the Renal System.
----------------------------------------------------------------------------------------------—
Implements biogears::PhysiologyEngine.
|
overridevirtual |
Returns the current state of the Respiratory System.
----------------------------------------------------------------------------------------------—
Implements biogears::PhysiologyEngine.
|
overridevirtual |
|
overridevirtual |
Retrieves the associated substance manager.
----------------------------------------------------------------------------------------------—
Implements biogears::PhysiologyEngine.
|
overridevirtual |
returns the engine time step that is used when advancing time.
----------------------------------------------------------------------------------------------—
Implements biogears::PhysiologyEngine.
|
overridevirtual |
Returns the current state of the tissue system.
----------------------------------------------------------------------------------------------—
Implements biogears::PhysiologyEngine.
|
overridevirtual |
locates the xml patient file and reads in the values.
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 biogears::PhysiologyEngine.
|
overridevirtual |
Implements biogears::PhysiologyEngine.
|
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 biogears::PhysiologyEngine.
|
protectedvirtual |
Run this again to clear out any bumps from systems resetting baselines in the last AtSteadyState call I would rather run Feedback stablization again, but... This does not work for a few patients, they will not stay stable (???)
|
overridevirtual |
Returns the current state of the AutoTracking Property. True implies for each time advance All DataRequest will be tracked if the current simulation time is a multiple of
GetDataRequestManager().GetSamplesPerSecond();
Implements biogears::PhysiologyEngine.
|
protectedvirtual |
|
overridevirtual |
Returns the current state of the Track Stabilization Property. When true the user expects the Results file to include engine values during stabilization routines
When false the user expects the 0 time index to be the first engine readout post stabilization.
Implements biogears::PhysiologyEngine.
|
overridevirtual |
Reset engine and set it to the state in the provided file. You may provided a Simulation Time to be used if desired. It will be reflected in the GetSimulationTime method. Return value indicates engine was able to load provided state file.
Engine will be in a cleared state if this method fails.
Implements biogears::PhysiologyEngine.
|
overridevirtual |
Implements biogears::PhysiologyEngine.
|
overridevirtual |
Reset engine and set it to the state in the provided file. You may provided a Simulation Time to be used if desired. It will be reflected in the GetSimulationTime method. Return value indicates engine was able to load provided state file.
Engine will be in a cleared state if this method fails.
Patient //
Implements biogears::PhysiologyEngine.
|
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 biogears::PhysiologyEngine.
|
overridevirtual |
Save the current state of the engine. State will be written to a file if provided. State object will be returned.
Engine will be in a cleared state if this method fails.
Implements biogears::PhysiologyEngine.
|
overridevirtual |
Implements biogears::PhysiologyEngine.
|
overridevirtual |
|
overridevirtual |
Add a callback object that will be called whenever a pateint or anesthesia machine event changes state
Implements biogears::PhysiologyEngine.
|
overridevirtual |
This value will be overridden if TrackingStabilizationCriteria is loaded by any means After it is set. But can be used as a shortcut to modify m_Config->GetStabilizationCriteria()->TrackStabilization()
After stabiliztion criteira has been loaded.
Implements biogears::PhysiologyEngine.
Member Data Documentation
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |