SEDynamicStabilization.h
1 /* Distributed under the Apache License, Version 2.0.
2  See accompanying NOTICE file for details.*/
3 
4 #pragma once
5 #include "engine/SEEngineStabilization.h"
7 
9 {
10  friend class PBEngine;//friend the serialization class
11 public:
13  virtual ~SEDynamicStabilization();
14 
15  virtual void Clear();
16 
17  bool SerializeToString(std::string& output, SerializationFormat m) const;
18  bool SerializeToFile(const std::string& filename, SerializationFormat m) const;
19  bool SerializeFromString(const std::string& src, SerializationFormat m);
20  bool SerializeFromFile(const std::string& filename, SerializationFormat m);
21 
22  virtual bool StabilizeRestingState(PhysiologyEngine& engine);
23  virtual bool StabilizeFeedbackState(PhysiologyEngine& engine);
24  virtual bool StabilizeConditions(PhysiologyEngine& engine, const SEConditionManager& conditions);
25 
26  virtual SEDynamicStabilizationEngineConvergence& GetRestingConvergence();
27  virtual const SEDynamicStabilizationEngineConvergence& GetRestingConvergence() const;
28 
29  virtual bool HasFeedbackConvergence() const;
30  virtual SEDynamicStabilizationEngineConvergence& GetFeedbackConvergence();
31  virtual const SEDynamicStabilizationEngineConvergence* GetFeedbackConvergence() const;
32 
33  virtual bool HasConditionConvergence(const std::string& name) const;
34  virtual void RemoveConditionConvergence(const std::string& name);
35  virtual SEDynamicStabilizationEngineConvergence& GetConditionConvergence(const std::string& name);
36  virtual const SEDynamicStabilizationEngineConvergence* GetConditionConvergence(const std::string& name) const;
37  virtual const std::map<std::string, SEDynamicStabilizationEngineConvergence*>& GetConditionConvergence() const;
38 
39 protected:
40 
41  virtual bool Stabilize(PhysiologyEngine& engine, const SEDynamicStabilizationEngineConvergence& criteria);
42 
45  std::map<std::string, SEDynamicStabilizationEngineConvergence*> m_ConditionConvergence;
46 
47  bool Merge();
49  std::map<std::string, SEDynamicStabilizationEngineConvergence*> m_ActiveConditions;
50 };
51 
virtual bool SerializeFromString(const std::string &src, SerializationFormat)=0
virtual bool SerializeToString(std::string &output, SerializationFormat) const =0
Definition: Logger.h:61
virtual bool SerializeFromFile(const std::string &filename, SerializationFormat)=0
std::map< std::string, SEDynamicStabilizationEngineConvergence * > m_ConditionConvergence
Definition: SEDynamicStabilization.h:45
SEDynamicStabilizationEngineConvergence * m_FeedbackConvergence
Definition: SEDynamicStabilization.h:44
Definition: SEDynamicStabilization.h:8
Definition: SEConditionManager.h:20
Definition: PBEngine.h:24
Definition: SEEngineStabilization.h:11
virtual bool StabilizeConditions(PhysiologyEngine &engine, const SEConditionManager &conditions)=0
Definition: PhysiologyEngine.h:52
virtual void Clear()
Definition: SEEngineStabilization.cpp:20
virtual bool SerializeToFile(const std::string &filename, SerializationFormat) const =0
virtual bool StabilizeFeedbackState(PhysiologyEngine &engine)=0
virtual bool StabilizeRestingState(PhysiologyEngine &engine)=0
std::map< std::string, SEDynamicStabilizationEngineConvergence * > m_ActiveConditions
Definition: SEDynamicStabilization.h:49
SEDynamicStabilizationEngineConvergence * m_RestingConvergence
Definition: SEDynamicStabilization.h:43
SEDynamicStabilizationEngineConvergence * m_MergedConditions
Definition: SEDynamicStabilization.h:48
Definition: SEDynamicStabilizationEngineConvergence.h:9