Engine.h
1/* Distributed under the Apache License, Version 2.0.
2 See accompanying NOTICE file for details.*/
3#pragma once
4
5#include "engine/CommonDefs.h"
6
7namespace pulse
8{
9 class Controller;
10 //--------------------------------------------------------------------------------------------------
17 //--------------------------------------------------------------------------------------------------
18 class PULSE_DECL Engine : public PhysiologyEngine
19 {
20 public:
21 Engine(Logger* logger=nullptr);
22 virtual ~Engine();
23
24 Logger* GetLogger() const override;
25
26 std::string GetTypeName() const override;
27
28 bool SerializeFromFile(const std::string& file) override;
29 bool SerializeToFile(const std::string& file) const override;
30
31 bool SerializeFromString(const std::string& state, eSerializationFormat m) override;
32 bool SerializeToString(std::string& state, eSerializationFormat m) const override;
33
34 bool InitializeEngine(const std::string& patient_configuration, eSerializationFormat m) override;
35 bool InitializeEngine(const SEPatientConfiguration& patient_configuration) override;
36 eEngineInitializationState GetInitializationState() const override;
37
38 void Clear() override;
39
40 bool SetConfigurationOverride(const SEEngineConfiguration* config) override;
41
42 const SEConditionManager& GetConditionManager() const override;
43
44 SEEngineTracker* GetEngineTracker() const override;
45
46 const SEEngineConfiguration* GetConfiguration() const override;
47
48 double GetTimeStep(const TimeUnit& unit) const override;
49 double GetSimulationTime(const TimeUnit& unit) const override;
50 void SetSimulationTime(const SEScalarTime& time) override;
51 double GetStabilizationTime(const TimeUnit& unit) const override;
52
53 bool AdvanceModelTime() override;
54 bool AdvanceModelTime(double time, const TimeUnit& unit) override;
55 bool ProcessAction(const SEAction& action) override;
56 const SEActionManager& GetActionManager() const override;
57
58 const SESubstanceManager& GetSubstanceManager() const override;
59 void SetAdvanceHandler(SEAdvanceHandler* handler) override;
60 const SEPatient& GetPatient() const override;
61 const SEPatient& GetInitialPatient() const override;
62 bool GetPatientAssessment(SEPatientAssessment& assessment) const override;
63
64 const SEEnvironment* GetEnvironment() const override;
65 const SEBloodChemistrySystem* GetBloodChemistrySystem() const override;
66 const SECardiovascularSystem* GetCardiovascularSystem() const override;
67 const SEDrugSystem* GetDrugSystem() const override;
68 const SEEndocrineSystem* GetEndocrineSystem() const override;
69 const SEEnergySystem* GetEnergySystem() const override;
70 const SEGastrointestinalSystem* GetGastrointestinalSystem() const override;
71 const SEHepaticSystem* GetHepaticSystem() const override;
72 const SENervousSystem* GetNervousSystem() const override;
73 const SERenalSystem* GetRenalSystem() const override;
74 const SERespiratorySystem* GetRespiratorySystem() const override;
75 const SETissueSystem* GetTissueSystem() const override;
76 const SEAnesthesiaMachine* GetAnesthesiaMachine() const override;
77 const SEBagValveMask* GetBagValveMask() const override;
78 const SEECMO* GetECMO() const override;
79 const SEElectroCardioGram* GetElectroCardioGram() const override;
80 const SEInhaler* GetInhaler() const override;
81 const SEMechanicalVentilator* GetMechanicalVentilator() const override;
82
83 const SECompartmentManager& GetCompartments() const override;
84 SEBlackBoxManager& GetBlackBoxes() const override;
85
86 const SEEventManager& GetEventManager() const override;
87
88 Controller& GetController() const;
89 protected:
90 virtual void AllocateController() const = 0;
91 mutable Controller* m_Controller=nullptr;
92 };
93END_NAMESPACE
Definition: Logger.h:71
Definition: PhysiologyEngine.h:68
Definition: SEAction.h:14
Definition: SEActionManager.h:12
Definition: SEAdvanceHandler.h:8
Definition: SEAnesthesiaMachine.h:24
Definition: SEBagValveMask.h:14
Definition: SEBlackBoxManager.h:11
Definition: SEBloodChemistrySystem.h:10
Definition: SECardiovascularSystem.h:24
Definition: SECompartmentManager.h:25
Definition: SEConditionManager.h:26
Definition: SEDrugSystem.h:9
Definition: SEECMO.h:10
Definition: SEElectroCardioGram.h:9
Definition: SEEndocrineSystem.h:8
Definition: SEEnergySystem.h:8
Definition: SEEngineConfiguration.h:8
Definition: SEEngineTracker.h:66
Definition: SEEnvironment.h:13
Definition: SEEventManager.h:117
Definition: SEGastrointestinalSystem.h:9
Definition: SEHepaticSystem.h:8
Definition: SEInhaler.h:12
Definition: SEMechanicalVentilator.h:10
Definition: SENervousSystem.h:9
Data formed at a level of a clinicians report. This is high level data, such as a mean or generalized...
Definition: SEPatientAssessment.h:22
Definition: SEPatientConfiguration.h:11
Definition: SEPatient.h:13
Definition: SERenalSystem.h:8
Definition: SERespiratorySystem.h:25
Definition: SEScalarTime.h:28
Definition: SESubstanceManager.h:9
Definition: SETissueSystem.h:8
Definition: SEScalarTime.h:8
Definition: Logger.h:14

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.