From e5a5041915127e72820a0478724a20dc41f0327e Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Mon, 26 Mar 2018 08:35:19 -0300 Subject: Control systems initialization bug fixed --- Project/MathExpression.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Project/MathExpression.cpp') 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; -- cgit