fix: derive the loop-detection threshold from the model bounds - #681
Merged
Conversation
randomSampling excluded loop reactions by testing maxF > 999 | minF < -999, a hardcoded ±1000 while the bound replacement eight lines below derives its threshold from the model. On any model whose bounds are on another scale (ecModels, 100-scale bounds) nothing matched, so no reaction was excluded and loops were sampled while the function reported success. The threshold now comes from the model's own bounds, and reactions that reach an infinite bound are excluded explicitly. Models bounded at ±1000 keep the previous behaviour exactly. Adds a test with a loop that runs to a 100 cap, which the old threshold missed entirely.
Function test results241 tests 219 ✅ 1m 0s ⏱️ Results for commit f9334b3. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Main improvements in this PR:
randomSamplingdetected loop reactions against a hardcoded ±1000. On a model whose bounds are on any other scale (ecModels, 100-scale bounds) that matched nothing, so no reaction was excluded and loops were sampled while the run reported success. The threshold now comes from the model's own bounds, matching how the bound replacement below it already works. Models bounded at ±1000 behave exactly as before.tSampling.mwith a loop running to a 100 cap.Instructions on merging this PR:
develop3as target branch, and will be resolved with a squash-merge.