The nervous class holds models of the peripheral and central nervous system. Currently, on the baroreceptor reflex is modeled. More...

#include <Nervous.h>

Inheritance diagram for biogears::Nervous:

Public Member Functions

virtual ~Nervous () override
 
const char * classname () const override
 
size_t hash_code () const override
 
void Clear () override
 
void Initialize () override
 Initializes system properties to valid homeostatic values. More...
 
virtual bool Load (const CDM::BioGearsNervousSystemData &in)
 
virtual CDM::BioGearsNervousSystemDataUnload () const override
 
SEScalarCalculateCentralNervousSOFA ()
 
void AtSteadyState () override
 Notify systems that steady state has been achieved. More...
 
void PreProcess () override
 Preprocess methods for the nervous system. More...
 
void Process () override
 Nervous Process Step. More...
 
void PostProcess () override
 Nervous PostProcess Step. More...
 
bool CalculatePsychomotorVigilanceTask (SEPsychomotorVigilanceTask &pvt)
 Sets data on the PVT object. More...
 
- Public Member Functions inherited from biogears::SENervousSystem
 SENervousSystem (Logger *logger)
 
 ~SENervousSystem () override
 
const SEScalarGetScalar (const char *name) override
 
const SEScalarGetScalar (const std::string &name) override
 
bool Load (const CDM::NervousSystemData &in)
 
Tree< const char * > GetPhysiologyRequestGraph () const override
 
bool HasComplianceScale () const
 
SEScalarGetComplianceScale ()
 
double GetComplianceScale () const
 
bool HasHeartRateScale () const
 
SEScalarGetHeartRateScale ()
 
double GetHeartRateScale () const
 
bool HasHeartElastanceScale () const
 
SEScalarGetHeartElastanceScale ()
 
double GetHeartElastanceScale () const
 
bool HasResistanceScaleExtrasplanchnic () const
 
SEScalarGetResistanceScaleExtrasplanchnic ()
 
double GetResistanceScaleExtrasplanchnic () const
 
bool HasResistanceScaleMuscle () const
 
SEScalarGetResistanceScaleMuscle ()
 
double GetResistanceScaleMuscle () const
 
bool HasResistanceScaleMyocardium () const
 
SEScalarGetResistanceScaleMyocardium ()
 
double GetResistanceScaleMyocardium () const
 
bool HasResistanceScaleSplanchnic () const
 
SEScalarGetResistanceScaleSplanchnic ()
 
double GetResistanceScaleSplanchnic () const
 
bool HasLeftEyePupillaryResponse () const
 
SEPupillaryResponseGetLeftEyePupillaryResponse ()
 
const SEPupillaryResponseGetLeftEyePupillaryResponse () const
 
void RemoveLeftEyePupillaryResponse ()
 
bool HasPainVisualAnalogueScale () const
 
SEScalarGetPainVisualAnalogueScale ()
 
double GetPainVisualAnalogueScale () const
 
bool HasRichmondAgitationSedationScale () const
 
SEScalarGetRichmondAgitationSedationScale ()
 
double GetRichmondAgitationSedationScale () const
 
bool HasRightEyePupillaryResponse () const
 
SEPupillaryResponseGetRightEyePupillaryResponse ()
 
const SEPupillaryResponseGetRightEyePupillaryResponse () const
 
void RemoveRightEyePupillaryResponse ()
 
bool IsAsleep () const
 
SEScalarTimeGetSleepTime ()
 
double GetSleepTime (const TimeUnit &unit) const
 
CDM::enumSleepState::value GetSleepState () const
 
void SetSleepState (CDM::enumSleepState::value sleep)
 
void InvalidateSleepState ()
 
bool HasSleepState () const
 
bool IsAwake () const
 
SEScalarTimeGetWakeTime ()
 
double GetWakeTime (const TimeUnit &unit) const
 
bool HasBiologicalDebt () const
 
SEScalarGetBiologicalDebt ()
 
double GetBiologicalDebt () const
 
bool HasReactionTime () const
 
SEScalarTimeGetReactionTime ()
 
double GetReactionTime (const TimeUnit &unit) const
 
bool HasAttentionLapses () const
 
SEScalarGetAttentionLapses ()
 
double GetAttentionLapses () const
 
- Public Member Functions inherited from biogears::SESystem
 SESystem (Logger *logger)
 
virtual ~SESystem ()
 
bool Load (const CDM::SystemData &in)
 
- Public Member Functions inherited from biogears::Loggable
 Loggable ()
 
 Loggable (Logger *log)
 
virtual ~Loggable ()
 
virtual LoggerGetLogger () const
 

Static Public Member Functions

static size_t TypeHash ()
 
static constexpr char const *const TypeTag ()
 
- Static Public Member Functions inherited from biogears::SENervousSystem
static size_t TypeHash ()
 
static constexpr char const *const TypeTag ()
 
- Static Public Member Functions inherited from biogears::SESystem
static const SEScalarGetScalar (const char *name, std::vector< SESystem * > *systems)
 
static const SEScalarGetScalar (const std::string &name, std::vector< SESystem * > *systems)
 

Protected Member Functions

 Nervous (BioGears &bg)
 
virtual void Unload (CDM::BioGearsNervousSystemData &data) const
 
void SetUp () override
 Initializes the nervous specific quantities. More...
 
void BaroreceptorFeedback ()
 Calculates the baroreceptor feedback and sets the scaling parameters in the CDM. More...
 
void CheckPainStimulus ()
 Calculates the patient pain response due to stimulus, susceptibility and drugs. More...
 
void CheckNervousStatus ()
 Checks metrics in the nervous system to determine events to be thrown. Currently includes brain status and presence of fasciculation. More...
 
void ChemoreceptorFeedback ()
 Calculates the chemoreceptor feedback and sets the scaling parameters in the CDM. More...
 
void SetPupilEffects ()
 Sets pupil size and reactivity modifiers based on drug and TBI effects. More...
 
void CalculateSleepEffects ()
 Cacluates the cumulative sleep debt burden on the patient. More...
 
void UpdateSleepState ()
 Update global nervous sleep state. More...
 
void AfferentResponse ()
 
void CentralSignalProcess ()
 
void EfferentResponse ()
 
void LocalAutoregulation ()
 Calculates the cerebral autoregulation and local autoregulation of muscle and myocardium. More...
 
- Protected Member Functions inherited from biogears::SENervousSystem
void Unload (CDM::NervousSystemData &data) const
 
- Protected Member Functions inherited from biogears::SESystem
void Unload (CDM::SystemData &data) const
 
- Protected Member Functions inherited from biogears::Loggable
virtual void Debug (const char *msg, const char *origin="") const
 
virtual void Debug (const std::string &msg, const std::string &origin=empty) const
 
virtual void Debug (std::ostream &msg, const std::string &origin=empty) const
 
virtual void Info (const char *msg, const char *origin="") const
 
virtual void Info (const std::string &msg, const std::string &origin=empty) const
 
virtual void Info (std::ostream &msg, const std::string &origin=empty) const
 
virtual void Warning (const char *msg, const char *origin="") const
 
virtual void Warning (const std::string &msg, const std::string &origin=empty) const
 
virtual void Warning (std::ostream &msg, const std::string &origin=empty) const
 
virtual void Error (const char *msg, const char *origin="") const
 
virtual void Error (const std::string msg, const std::string origin=empty) const
 
virtual void Error (std::ostream &msg, const std::string &origin=empty) const
 
virtual void Fatal (const char *msg, const char *origin="") const
 
virtual void Fatal (const std::string &msg, const std::string &origin=empty) const
 
virtual void Fatal (std::ostream &msg, const std::string &origin=empty) const
 
- Protected Member Functions inherited from biogears::BioGearsSystem
virtual void LoadState ()
 

Static Protected Member Functions

static auto make_unique (BioGears &bg) -> std::unique_ptr< Nervous >
 

Protected Attributes

BioGearsm_data
 
double m_AfferentChemoreceptor_Hz
 
double m_AfferentPulmonaryStretchReceptor_Hz
 
double m_AorticBaroreceptorStrain
 
double m_AttentionLapses
 
double m_ArterialOxygenBaseline_mmHg
 
double m_ArterialCarbonDioxideBaseline_mmHg
 
double m_BaroreceptorOperatingPoint_mmHg
 
double m_BiologicalDebt
 
double m_CardiopulmonaryInputBaseline_mmHg
 
double m_CardiopulmonaryInput_mmHg
 
double m_CarotidBaroreceptorStrain
 
double m_CentralFrequencyDelta_Per_min
 
double m_CentralPressureDelta_cmH2O
 
std::vector< double > m_CerebralArteriesEffectors_Large
 
std::vector< double > m_CerebralArteriesEffectors_Small
 
double m_CerebralOxygenSaturationBaseline
 
double m_CerebralPerfusionPressureBaseline_mmHg
 
double m_ChemoreceptorFiringRateSetPoint_Hz
 
double m_CerebralBloodFlowBaseline_mL_Per_s
 
double m_CerebralBloodFlowInput_mL_Per_s
 
double m_ComplianceModifier
 
double m_HeartElastanceModifier
 
double m_HeartOxygenBaseline
 
double m_HeartRateModifierSympathetic
 
double m_HeartRateModifierVagal
 
double m_HypercapniaThresholdHeart
 
double m_HypercapniaThresholdPeripheral
 
double m_HypoxiaThresholdHeart
 
double m_HypoxiaThresholdPeripheral
 
double m_MeanLungVolume_L
 
double m_MuscleOxygenBaseline
 
double m_OxygenAutoregulatorHeart
 
double m_OxygenAutoregulatorMuscle
 
double m_PeripheralBloodGasInteractionBaseline_Hz
 
double m_PeripheralFrequencyDelta_Per_min
 
double m_PeripheralPressureDelta_cmH2O
 
double m_ReactionTime_s
 
double m_ResistanceModifierExtrasplanchnic
 
double m_ResistanceModifierMuscle
 
double m_ResistanceModifierSplanchnic
 
double m_SympatheticPeripheralSignalBaseline_Hz
 
double m_SympatheticSinoatrialSignalBaseline_Hz
 
double m_SympatheticPeripheralSignalFatigue
 
double m_TiredTime_hr
 
double m_VagalSignalBaseline_Hz
 
double m_AfferentBaroreceptorAortic_Hz
 
double m_AfferentBaroreceptorCarotid_Hz
 
double m_AfferentCardiopulmonary_Hz
 
double m_DrugRespirationEffects
 
bool m_FeedbackActive
 
double m_dt_s
 
SESubstancem_Succinylcholine
 
SESubstancem_Sarin
 
SEPatientm_Patient
 
bool m_blockActive
 
double m_painStimulusDuration_s
 
double m_painVASDuration_s
 
double m_painVAS
 
double m_painStimulus
 
double m_SympatheticSinoatrialSignal_Hz
 
double m_SympatheticPeripheralSignal_Hz
 
double m_VagalSignal_Hz
 
- Protected Attributes inherited from biogears::SENervousSystem
SEScalarm_ComplianceScale
 
SEScalarm_HeartRateScale
 
SEScalarm_HeartElastanceScale
 
SEPupillaryResponsem_LeftEyePupillaryResponse
 
SEPupillaryResponsem_RightEyePupillaryResponse
 
SEScalarm_PainVisualAnalogueScale
 
SEScalarm_ResistanceScaleExtrasplanchnic
 
SEScalarm_ResistanceScaleMuscle
 
SEScalarm_ResistanceScaleMyocardium
 
SEScalarm_ResistanceScaleSplanchnic
 
SEScalarTimem_SleepTime
 
SEScalarTimem_WakeTime
 
CDM::enumSleepState::value m_SleepState
 
SEScalarm_BiologicalDebt
 
SEScalarTimem_ReactionTime
 
SEScalarm_AttentionLapses
 
SEScalarm_RichmondAgitationSedationScale
 
- Protected Attributes inherited from biogears::SESystem
std::stringstream m_ss
 
- Protected Attributes inherited from biogears::Loggable
Loggerm_Logger
 

Friends

class BioGears
 
class BioGearsEngineTest
 

Additional Inherited Members

- Static Public Attributes inherited from biogears::Loggable
static const std::string empty
 
static const char * empty_cStr
 

Detailed Description

The nervous class holds models of the peripheral and central nervous system. Currently, on the baroreceptor reflex is modeled.

Constructor & Destructor Documentation

biogears::Nervous::Nervous ( BioGears bg)
protected
biogears::Nervous::~Nervous ( )
overridevirtual

Member Function Documentation

void biogears::Nervous::AfferentResponse ( )
protected
void biogears::Nervous::AtSteadyState ( )
overridevirtual

Notify systems that steady state has been achieved.

Reimplemented from biogears::BioGearsSystem.

void biogears::Nervous::BaroreceptorFeedback ( )
protected

Calculates the baroreceptor feedback and sets the scaling parameters in the CDM.

The baroreceptor feedback function uses the current mean arterial pressure relative to the mean arterial pressure set-point in order to calculate the sympathetic and parasympathetic response fractions. These fractions are used to update the scaling parameters of heart rate, heart elastance, resistance and compliance for each time step.

Todo:
Add decompensation. Perhaps a reduction in the effect that is a function of blood volume below a threshold... and maybe time.
SEScalar & biogears::Nervous::CalculateCentralNervousSOFA ( )
bool biogears::Nervous::CalculatePsychomotorVigilanceTask ( SEPsychomotorVigilanceTask pvt)

Sets data on the PVT object.

Uses information from calculatesleepeffects routine (see nervous-assessments)

void biogears::Nervous::CalculateSleepEffects ( )
protected

Cacluates the cumulative sleep debt burden on the patient.

Models for metabolic changes, vigilance and awareness changes are computed here. These models effect physiology data requests and the tissue system

void biogears::Nervous::CentralSignalProcess ( )
protected
void biogears::Nervous::CheckNervousStatus ( )
protected

Checks metrics in the nervous system to determine events to be thrown. Currently includes brain status and presence of fasciculation.

Intracranial pressure is checked to determine if the patient has Intracranial Hyper/hypotension Fasciculation can occur as a result of calcium/magnesium deficiency (or other electrolyte imbalances),succinylcholine, nerve agents, ALS Currently, only fasciculations due to the nerve agent Sarin are active. Other causes are a subject of model improvement

Event:
Patient: Intracranial Hypertension. The intracranial pressure has risen above 25 mmHg.
Event:
Patient: End Intracranial Hypertension. The intracranial pressure has fallen below 24 mmHg.
Event:
Patient: Intracranial Hypotension. The intracranial pressure has fallen below 7 mmHg.
Event:
Patient: End Intracranial Hypotension. The intracranial pressure has risen above 7.5 mmHg.

[nambda1971cholinesterase]

[11], [214]

void biogears::Nervous::CheckPainStimulus ( )
protected

Calculates the patient pain response due to stimulus, susceptibility and drugs.

A patient reacts to a noxious stimulus in a certain way. Generally this is reported as a VAS scale value. This value is generally reported by the patient after the nervous system has already parsed the stimulus. For a robotic manikin trainer we need to determine the nervous system and systemic responses related to that stimulus

void biogears::Nervous::ChemoreceptorFeedback ( )
protected

Calculates the chemoreceptor feedback and sets the scaling parameters in the CDM.

The chemoreceptor feedback function uses the current arterial partial pressure of oxygen and carbon dioxide relative to the partial pressure set-points in order to calculate response signal. The affected systems identify the signal and adjust accordingly. Note that chemoreception is currently built into the respiratory driver; therefore, the chemoreceptor feedback only sets CV modifiers.

const char* biogears::Nervous::classname ( ) const
inlineoverridevirtual

Reimplemented from biogears::SENervousSystem.

void biogears::Nervous::Clear ( )
overridevirtual

Reimplemented from biogears::SENervousSystem.

void biogears::Nervous::EfferentResponse ( )
protected
size_t biogears::Nervous::hash_code ( ) const
inlineoverridevirtual

Reimplemented from biogears::SENervousSystem.

void biogears::Nervous::Initialize ( )
overridevirtual

Initializes system properties to valid homeostatic values.

Reimplemented from biogears::BioGearsSystem.

bool biogears::Nervous::Load ( const CDM::BioGearsNervousSystemData in)
virtual
void biogears::Nervous::LocalAutoregulation ( )
protected

Calculates the cerebral autoregulation and local autoregulation of muscle and myocardium.

auto biogears::Nervous::make_unique ( BioGears bg) -> std::unique_ptr<Nervous>
staticprotected
void biogears::Nervous::PostProcess ( )
overridevirtual

Nervous PostProcess Step.

Currently no nervous postprocess methods.

Implements biogears::BioGearsSystem.

void biogears::Nervous::PreProcess ( )
overridevirtual

Preprocess methods for the nervous system.

Computes nervous system regulation of the body. Baroreceptor and chemoreceptor feedback is computed and modifiers set in preparation for systems processing.

Implements biogears::BioGearsSystem.

void biogears::Nervous::Process ( )
overridevirtual

Nervous Process Step.

The only current Process-specific function checks the brain status to set events.

Implements biogears::BioGearsSystem.

void biogears::Nervous::SetPupilEffects ( )
protected

Sets pupil size and reactivity modifiers based on drug and TBI effects.

Modifiers are on a scale between -1 (for reduction in size/reactivity) and 1 (for increase) TBI effects are applied to the eye on the same side of the injury if localized or both if diffuse Drug and TBI pupil effects are simply summed together

void biogears::Nervous::SetUp ( )
overrideprotectedvirtual

Initializes the nervous specific quantities.

Initializes the nervous system.

Implements biogears::BioGearsSystem.

static size_t biogears::Nervous::TypeHash ( )
inlinestatic
static constexpr char const* const biogears::Nervous::TypeTag ( )
inlinestatic
CDM::BioGearsNervousSystemData * biogears::Nervous::Unload ( ) const
overridevirtual

Reimplemented from biogears::SENervousSystem.

void biogears::Nervous::Unload ( CDM::BioGearsNervousSystemData data) const
protectedvirtual
void biogears::Nervous::UpdateSleepState ( )
protected

Update global nervous sleep state.

Update sleep state when action is used.

Friends And Related Function Documentation

friend class BioGears
friend
friend class BioGearsEngineTest
friend

Member Data Documentation

double biogears::Nervous::m_AfferentBaroreceptorAortic_Hz
protected
double biogears::Nervous::m_AfferentBaroreceptorCarotid_Hz
protected
double biogears::Nervous::m_AfferentCardiopulmonary_Hz
protected
double biogears::Nervous::m_AfferentChemoreceptor_Hz
protected
double biogears::Nervous::m_AfferentPulmonaryStretchReceptor_Hz
protected
double biogears::Nervous::m_AorticBaroreceptorStrain
protected
double biogears::Nervous::m_ArterialCarbonDioxideBaseline_mmHg
protected
double biogears::Nervous::m_ArterialOxygenBaseline_mmHg
protected
double biogears::Nervous::m_AttentionLapses
protected
double biogears::Nervous::m_BaroreceptorOperatingPoint_mmHg
protected
double biogears::Nervous::m_BiologicalDebt
protected
bool biogears::Nervous::m_blockActive
protected
double biogears::Nervous::m_CardiopulmonaryInput_mmHg
protected
double biogears::Nervous::m_CardiopulmonaryInputBaseline_mmHg
protected
double biogears::Nervous::m_CarotidBaroreceptorStrain
protected
double biogears::Nervous::m_CentralFrequencyDelta_Per_min
protected
double biogears::Nervous::m_CentralPressureDelta_cmH2O
protected
std::vector<double> biogears::Nervous::m_CerebralArteriesEffectors_Large
protected
std::vector<double> biogears::Nervous::m_CerebralArteriesEffectors_Small
protected
double biogears::Nervous::m_CerebralBloodFlowBaseline_mL_Per_s
protected
double biogears::Nervous::m_CerebralBloodFlowInput_mL_Per_s
protected
double biogears::Nervous::m_CerebralOxygenSaturationBaseline
protected
double biogears::Nervous::m_CerebralPerfusionPressureBaseline_mmHg
protected
double biogears::Nervous::m_ChemoreceptorFiringRateSetPoint_Hz
protected
double biogears::Nervous::m_ComplianceModifier
protected
BioGears& biogears::Nervous::m_data
protected
double biogears::Nervous::m_DrugRespirationEffects
protected
double biogears::Nervous::m_dt_s
protected
bool biogears::Nervous::m_FeedbackActive
protected
double biogears::Nervous::m_HeartElastanceModifier
protected
double biogears::Nervous::m_HeartOxygenBaseline
protected
double biogears::Nervous::m_HeartRateModifierSympathetic
protected
double biogears::Nervous::m_HeartRateModifierVagal
protected
double biogears::Nervous::m_HypercapniaThresholdHeart
protected
double biogears::Nervous::m_HypercapniaThresholdPeripheral
protected
double biogears::Nervous::m_HypoxiaThresholdHeart
protected
double biogears::Nervous::m_HypoxiaThresholdPeripheral
protected
double biogears::Nervous::m_MeanLungVolume_L
protected
double biogears::Nervous::m_MuscleOxygenBaseline
protected
double biogears::Nervous::m_OxygenAutoregulatorHeart
protected
double biogears::Nervous::m_OxygenAutoregulatorMuscle
protected
double biogears::Nervous::m_painStimulus
protected
double biogears::Nervous::m_painStimulusDuration_s
protected
double biogears::Nervous::m_painVAS
protected
double biogears::Nervous::m_painVASDuration_s
protected
SEPatient* biogears::Nervous::m_Patient
protected
double biogears::Nervous::m_PeripheralBloodGasInteractionBaseline_Hz
protected
double biogears::Nervous::m_PeripheralFrequencyDelta_Per_min
protected
double biogears::Nervous::m_PeripheralPressureDelta_cmH2O
protected
double biogears::Nervous::m_ReactionTime_s
protected
double biogears::Nervous::m_ResistanceModifierExtrasplanchnic
protected
double biogears::Nervous::m_ResistanceModifierMuscle
protected
double biogears::Nervous::m_ResistanceModifierSplanchnic
protected
SESubstance* biogears::Nervous::m_Sarin
protected
SESubstance* biogears::Nervous::m_Succinylcholine
protected
double biogears::Nervous::m_SympatheticPeripheralSignal_Hz
protected
double biogears::Nervous::m_SympatheticPeripheralSignalBaseline_Hz
protected
double biogears::Nervous::m_SympatheticPeripheralSignalFatigue
protected
double biogears::Nervous::m_SympatheticSinoatrialSignal_Hz
protected
double biogears::Nervous::m_SympatheticSinoatrialSignalBaseline_Hz
protected
double biogears::Nervous::m_TiredTime_hr
protected
double biogears::Nervous::m_VagalSignal_Hz
protected
double biogears::Nervous::m_VagalSignalBaseline_Hz
protected