diff options
author | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2018-03-26 08:35:19 -0300 |
---|---|---|
committer | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2018-03-26 08:35:19 -0300 |
commit | e5a5041915127e72820a0478724a20dc41f0327e (patch) | |
tree | 176149cbc29ed27303647992c73d4a84e9862cce /Project/MathExpression.cpp | |
parent | 29af4e28898f44df444fef5534134c6b6000418d (diff) | |
download | PSP.git-e5a5041915127e72820a0478724a20dc41f0327e.tar.gz PSP.git-e5a5041915127e72820a0478724a20dc41f0327e.tar.xz PSP.git-e5a5041915127e72820a0478724a20dc41f0327e.zip |
Control systems initialization bug fixed
Diffstat (limited to 'Project/MathExpression.cpp')
-rw-r--r-- | Project/MathExpression.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Project/MathExpression.cpp b/Project/MathExpression.cpp index f22b828..0577c32 100644 --- a/Project/MathExpression.cpp +++ b/Project/MathExpression.cpp @@ -175,7 +175,10 @@ bool MathExpression::Solve(double* input, double timeStep) for(auto itCN = nodeList.begin(), itCNEnd = nodeList.end(); itCN != itCNEnd; ++itCN) { Node* childNode = *itCN; if(childNode == node) { - m_inputValues[i] = cLine->GetValue(); + if(!cLine->IsSolved()) + m_inputValues[i] = 0.0; + else + m_inputValues[i] = cLine->GetValue(); break; } } @@ -328,7 +331,7 @@ bool MathExpression::Initialize() // Optimize only once to gain performance. m_fparser.Optimize(); - + m_solved = false; m_output = 0.0; return true; |