diff options
author | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2017-05-06 18:28:23 -0300 |
---|---|---|
committer | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2017-05-06 18:28:23 -0300 |
commit | 74d795cb074b6ae9aa93bcfacee8995d7e6d5945 (patch) | |
tree | ea56758240928de036e9632dde2fb94bb634ba08 /Project/ControlElementSolver.h | |
parent | 412ddd0fa4a6e32651619897c8606d4cbaaa1ffa (diff) | |
download | PSP.git-74d795cb074b6ae9aa93bcfacee8995d7e6d5945.tar.gz PSP.git-74d795cb074b6ae9aa93bcfacee8995d7e6d5945.tar.xz PSP.git-74d795cb074b6ae9aa93bcfacee8995d7e6d5945.zip |
Streight control solver implemented
Buggy, running 2x... Why??
Diffstat (limited to 'Project/ControlElementSolver.h')
-rw-r--r-- | Project/ControlElementSolver.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/Project/ControlElementSolver.h b/Project/ControlElementSolver.h index 47838d7..9ca6e02 100644 --- a/Project/ControlElementSolver.h +++ b/Project/ControlElementSolver.h @@ -1,7 +1,7 @@ #ifndef CONTROLELEMENTSOLVER_H #define CONTROLELEMENTSOLVER_H -#include <stddef.h> // NULL definition +#include <stddef.h> // NULL definition #include <vector> class ControlElementContainer; @@ -21,19 +21,23 @@ class ControlElementSolver { public: ControlElementSolver() {} - ControlElementSolver(ControlEditor* controlEditor, double timeStep = 1e-3, bool startAllZero = false, double input = 0.0); + ControlElementSolver(ControlEditor* controlEditor, + double timeStep = 1e-3, + bool startAllZero = false, + double input = 0.0); ~ControlElementSolver() {} - virtual void InitializeValues(double input); virtual void SolveNextStep(double input); virtual std::vector<double> GetSolutions() { return m_solutions; } - virtual double GetLastSolution() {return m_solutions[m_solutions.size() - 1];} - + virtual double GetLastSolution() { return m_solutions[m_solutions.size() - 1]; } protected: + void FillAllConnectedChildren(ConnectionLine* parent); + ConnectionLine* SolveNextElement(ConnectionLine* currentLine); + ControlElementContainer* m_ctrlContainer = NULL; double m_timeStep; std::vector<double> m_solutions; - + IOControl* m_inputControl = NULL; IOControl* m_outputControl = NULL; }; |