Skip to content

Commit

Permalink
Merge pull request #984 from sys-bio/resetAll-on-set-init
Browse files Browse the repository at this point in the history
Switch to resetAll when setting an init() value.
  • Loading branch information
luciansmith committed Apr 6, 2022
2 parents 3542ba0 + 0055eb3 commit 9d4e698
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 8 additions & 3 deletions source/rrRoadRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4346,9 +4346,14 @@ namespace rr {

SelectionRecord sel(sId);

if (sel.selectionType == SelectionRecord::INITIAL_AMOUNT ||
sel.selectionType == SelectionRecord::INITIAL_CONCENTRATION) {
reset();
if (sel.selectionType & SelectionRecord::INITIAL) {
reset(
SelectionRecord::TIME |
SelectionRecord::RATE |
SelectionRecord::FLOATING |
SelectionRecord::BOUNDARY |
SelectionRecord::COMPARTMENT |
SelectionRecord::GLOBAL_PARAMETER);
}
}

Expand Down
4 changes: 2 additions & 2 deletions wrappers/C/rrc_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -3048,8 +3048,8 @@ C_DECL_SPEC RRCDataPtr rrcCallConv gillespieMeanSDOnGridEx(RRHandle handle, doub
C_DECL_SPEC bool rrcCallConv reset(RRHandle handle);

/*!
\brief Resets all variables of the model to their current initial values,
and resets all parameters to their original values.
\brief Resets all variables of all types in the model to their
current initial values.
\param[in] handle Handle to a RoadRunner instance
\return Boolean indicating success
Expand Down

0 comments on commit 9d4e698

Please sign in to comment.