diff --git a/source/rrRoadRunner.cpp b/source/rrRoadRunner.cpp index dbfd1547a7..058f05f1e5 100644 --- a/source/rrRoadRunner.cpp +++ b/source/rrRoadRunner.cpp @@ -1332,8 +1332,8 @@ const DoubleMatrix* RoadRunner::simulate(const Dictionary* dict) applySimulateOptions(); - const double timeEnd = self.simulateOpt.duration + self.simulateOpt.start; - const double timeStart = self.simulateOpt.start; + const double timeEnd = self.simulateOpt.duration; + const double timeStart = 0; // evalute the model with its current state self.model->getStateVectorRate(timeStart, 0, 0); @@ -1563,6 +1563,12 @@ const DoubleMatrix* RoadRunner::simulate(const Dictionary* dict) Log(Logger::LOG_DEBUG) << "Simulation done.."; + for (int i = 0; i < self.simulationResult.numRows(); i++) { + self.simulationResult[i][getTimeRowIndex()] = self.simulationResult[i][getTimeRowIndex()] + self.simulateOpt.start; + } + + Log(Logger::LOG_DEBUG) << "Added delta T."; + return &self.simulationResult; } @@ -4049,10 +4055,9 @@ void RoadRunner::applySimulateOptions() { get_self(); - if (self.simulateOpt.duration < 0 || self.simulateOpt.start < 0 - || self.simulateOpt.steps < 0 ) + if (self.simulateOpt.duration < 0 || self.simulateOpt.steps < 0 ) { - throw std::invalid_argument("duration, startTime and steps must be non-negative"); + throw std::invalid_argument("duration and steps must be non-negative"); } // This one creates the list of what we will look at in the result