-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow enabling/disabling state reinitialization for individual states #1345
Comments
Turns out my original plan doesn't work out as smoothly as hoped for (started on #1344). The inconvenience is, that one would have to add one additional constant to the model for each state (or group of states) that one may want to conditionally reinitialize or not. Not completely sure how the ideal interface for that would look like. Would be good if one could enable/disable state reinitialization for individual states via ExpData, and without adding additional model parameters/constants. Any ideas comments on how to best handle that? Ideally that would be also easily adaptable to more complex setups than preequilibration+simulation, where one might want to specify multiple (time-dependent) state reinitializations (independently of SBML events). |
The problem is how the functions x0_fixedParameters and sx0_fixedParameters work, right? |
Yes, the overall problem/motivation is that you can't use |
well, obviously one could hack this by saving the old state and wrapping around the current code in C++. But this is cumbersome and error-prone. Better would be to add an "ix" variable to the headers of those two functions/files, implementing a switch statement in the files themselves, like this is already done for sensitivity function files with ip or event function files now with ie. So, we already have a very comparable concept for similar cases... Btw.: This functionality would also be highly welcome when dealing with adjoint preequilibration... |
Oh, somehow I overlooked your reply @paulstapor . Sounds good, either some index list, or a boolean array. Maybe the former is better, as it's more in line with @FFroehlich - works for you? Any other suggestions? |
Sounds good! |
Just to make sure we are talking about the same thing. We would:
For PEtab import that would mean that for constant initial values in the condition table, that for any state there, we would add a constant parameter that we would set to that value of the respective condition. If any condition has an estimated parameter there, we'd have to add a non-constant parameter there (or two, one for beforepreequilibration and one for afterwards). |
Yes, sounds good! |
Should indeed be (s)x0_fixedParameters, I think..
Somehow not completely sure whether I got that... |
How should that interact with the existing A) If A is the only backward compatible solution, but C seems more reasonable. |
I agree that I am currently under the impression that debugging anything in AMICI has become very tedious, particularly with the changes to ExpData and think we should keep this in mind that ease of use outside PEtab applications is still important. What about turning the boolean into enums with |
Which changes do you mean exactly? Agreed with the last point. (If it's easy to use without PEtab, it also makes PEtab import easier to implement...)
Would be an option. It's only slightly annoying and a potential source of error if one needs to flip two switches instead of one. Alternatively something corresponding to |
ExpData is really super cumbersome to modify, so what I usually have to do is move all simulation specs to model, remove them from ExpData and then perturb them to figure out whats going on.
I see your point, going with something along the lines of |
…fixes (#1417) Adds possibility to provide state indices for selective reinitialization based on fixed parameters. The previous `ExpData::reinitializeFixedParameterInitialStates` is still there, but will be removed in an upcoming version. Addresses #1345, #1396, #1319 Supersedes #1344 Include new test cases from PEtab-dev/petab_test_suite#35
Included in 0.11.13 |
So far, state-reinitialization can is only be switched on/off for all states (whose initial state depends on fixedParameters) at once.
Would be convenient, it this could be handled more dynamically by ignoring any reinitialization for the states for which x0 evaluates to NaN.
The text was updated successfully, but these errors were encountered: