SEEnergySystem.h
1 /**************************************************************************************
2 Copyright 2015 Applied Research Associates, Inc.
3 Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4 this file except in compliance with the License. You may obtain a copy of the License
5 at:
6 http://www.apache.org/licenses/LICENSE-2.0
7 Unless required by applicable law or agreed to in writing, software distributed under
8 the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9 CONDITIONS OF ANY KIND, either express or implied. See the License for the
10 specific language governing permissions and limitations under the License.
11 **************************************************************************************/
12 
13 #pragma once
14 #include <biogears/cdm/system/SESystem.h>
15 #include <biogears/schema/biogears/BioGearsPhysiology.hxx>
16 
17 namespace biogears {
18 class SEScalarFraction;
19 class SEScalarMass;
20 class MassUnit;
21 class SEScalarTemperature;
22 class TemperatureUnit;
23 class SEScalarAmountPerTime;
24 class AmountPerTimeUnit;
25 class SEScalarPressure;
26 class PressureUnit;
27 class SEScalarMassPerTime;
28 class MassPerTimeUnit;
29 class SEScalarPower;
30 class PowerUnit;
31 
32 class BIOGEARS_API SEEnergySystem : public SESystem {
33 public:
34  SEEnergySystem(Logger* logger);
35  ~SEEnergySystem() override;
36 
37  static size_t TypeHash() { return reinterpret_cast<size_t>(&TypeHash); }
38  static constexpr char const * const TypeTag() { return "SEEnergySystem"; }
39  const char* classname() const override { return TypeTag(); }
40  size_t hash_code() const override { return TypeHash(); }
41 
42  void Clear() override; // Deletes all members
43 
44  const SEScalar* GetScalar(const char* name) override;
45  const SEScalar* GetScalar(const std::string& name) override;
46 
47  bool Load(const CDM::EnergySystemData& in);
48  CDM::EnergySystemData* Unload() const override;
49 
50  Tree<const char*> GetPhysiologyRequestGraph() const override;
51 protected:
52  void Unload(CDM::EnergySystemData& data) const;
53 
54 public:
55  bool HasAchievedExerciseLevel() const;
56  SEScalarFraction& GetAchievedExerciseLevel();
57  double GetAchievedExerciseLevel() const;
58 
59  bool HasChlorideLostToSweat() const;
60  SEScalarMass& GetChlorideLostToSweat();
61  double GetChlorideLostToSweat(const MassUnit& unit) const;
62 
63  bool HasCoreTemperature() const;
64  SEScalarTemperature& GetCoreTemperature();
65  double GetCoreTemperature(const TemperatureUnit& unit) const;
66 
67  bool HasCreatinineProductionRate() const;
68  SEScalarAmountPerTime& GetCreatinineProductionRate();
69  double GetCreatinineProductionRate(const AmountPerTimeUnit& unit) const;
70 
71  bool HasEnergyDeficit() const;
72  SEScalarPower& GetEnergyDeficit();
73  double GetEnergyDeficit(const PowerUnit& unit) const;
74 
75  bool HasExerciseEnergyDemand() const;
76  SEScalarPower& GetExerciseEnergyDemand();
77  double GetExerciseEnergyDemand(const PowerUnit& unit) const;
78 
79  bool HasExerciseMeanArterialPressureDelta() const;
80  SEScalarPressure& GetExerciseMeanArterialPressureDelta();
81  double GetExerciseMeanArterialPressureDelta(const PressureUnit& unit) const;
82 
83  bool HasFatigueLevel() const;
84  SEScalarFraction& GetFatigueLevel();
85  double GetFatigueLevel() const;
86 
87  bool HasLactateProductionRate() const;
88  SEScalarAmountPerTime& GetLactateProductionRate();
89  double GetLactateProductionRate(const AmountPerTimeUnit& unit) const;
90 
91  bool HasPotassiumLostToSweat() const;
92  SEScalarMass& GetPotassiumLostToSweat();
93  double GetPotassiumLostToSweat(const MassUnit& unit) const;
94 
95  bool HasSkinTemperature() const;
96  SEScalarTemperature& GetSkinTemperature();
97  double GetSkinTemperature(const TemperatureUnit& unit) const;
98 
99  bool HasSodiumLostToSweat() const;
100  SEScalarMass& GetSodiumLostToSweat();
101  double GetSodiumLostToSweat(const MassUnit& unit) const;
102 
103  bool HasSweatRate() const;
104  SEScalarMassPerTime& GetSweatRate();
105  double GetSweatRate(const MassPerTimeUnit& unit) const;
106 
107  bool HasTotalMetabolicRate() const;
108  SEScalarPower& GetTotalMetabolicRate();
109  double GetTotalMetabolicRate(const PowerUnit& unit) const;
110 
111  bool HasTotalWorkRateLevel() const;
112  SEScalarFraction& GetTotalWorkRateLevel();
113  double GetTotalWorkRateLevel() const;
114 
115 protected:
131 };
132 }
SEScalarFraction * m_AchievedExerciseLevel
Definition: SEEnergySystem.h:116
SEScalarMassPerTime * m_SweatRate
Definition: SEEnergySystem.h:128
SEScalarAmountPerTime * m_CreatinineProductionRate
Definition: SEEnergySystem.h:119
SEScalarPower * m_EnergyDeficit
Definition: SEEnergySystem.h:120
SEScalarAmountPerTime * m_LactateProductionRate
Definition: SEEnergySystem.h:124
size_t hash_code() const override
Definition: SEEnergySystem.h:40
Definition: SEScalarAmountPerTime.h:38
Definition: SEScalar.h:33
static constexpr char const *const TypeTag()
Definition: SEEnergySystem.h:38
Definition: SEScalarTemperature.h:36
SEScalarFraction * m_TotalWorkRateLevel
Definition: SEEnergySystem.h:130
SEScalarPressure * m_ExerciseMeanArterialPressureDelta
Definition: SEEnergySystem.h:122
SEScalarPower * m_ExerciseEnergyDemand
Definition: SEEnergySystem.h:121
Definition: SESystem.h:27
Definition: SEScalarTemperature.h:18
Definition: SEScalarMass.h:38
SEScalarMass * m_PotassiumLostToSweat
Definition: SEEnergySystem.h:125
SEScalarTemperature * m_SkinTemperature
Definition: SEEnergySystem.h:126
SEScalarMass * m_SodiumLostToSweat
Definition: SEEnergySystem.h:127
Definition: Logger.h:75
SEScalarFraction * m_FatigueLevel
Definition: SEEnergySystem.h:123
Class corresponding to the EnergySystemData schema type.
Definition: Physiology.hxx:9611
Definition: SEScalarFraction.h:18
SEScalarTemperature * m_CoreTemperature
Definition: SEEnergySystem.h:118
Definition: SEScalarMassPerTime.h:18
const char * classname() const override
Definition: SEEnergySystem.h:39
Definition: SEScalarPower.h:38
Definition: SEScalarPower.h:18
Definition: SEScalarPressure.h:37
Definition: SEEnergySystem.h:32
Definition: SEScalarAmountPerTime.h:18
Definition: SEScalarMassPerTime.h:40
Definition: SEScalarPressure.h:18
SEScalarMass * m_ChlorideLostToSweat
Definition: SEEnergySystem.h:117
Definition: SEScalarMass.h:18
Definition: SEElectricalCircuit.h:18
static size_t TypeHash()
Definition: SEEnergySystem.h:37
SEScalarPower * m_TotalMetabolicRate
Definition: SEEnergySystem.h:129