Skip to content

Commit

Permalink
Merge pull request #643 from StochSS/hotfix/pause-resume-2
Browse files Browse the repository at this point in the history
HOTFIX: Pause Resume v2
  • Loading branch information
briandrawert authored Nov 17, 2021
2 parents 76bcdf1 + a076f19 commit 8162083
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gillespy2/solvers/cpp/c_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,14 +324,14 @@ def _update_resume_data(self, resume: Results, simulation_data: "list[dict[str,
resume_time = float(resume["time"][-1])
increment = resume_time - float(resume["time"][-2])
# Replace the simulation's timespan to continue where the Results object left off.
simulation_data[-1]["time"] = numpy.arange(start=(resume_time + increment),
simulation_data[-1]["time"] = numpy.arange(start=(resume_time),
stop=(resume_time + time_stopped + increment),
step=increment)

for entry_name, entry_data in simulation_data[-1].items():
# The results of the current simulation is treated as an "extension" of the resume data.
# As such, the new simulation output is formed by joining the two end to end.
new_data = numpy.concatenate((resume[entry_name], entry_data), axis=None)
new_data = numpy.concatenate((resume[entry_name], entry_data[1:]), axis=None)
simulation_data[-1][entry_name] = new_data

return simulation_data
Expand Down

0 comments on commit 8162083

Please sign in to comment.