Fixes #2754 Parameter Identification: erroneous behavior of "Transfer results to Simulation" in combination with "Use as factor"#2755
Merged
rwmcintosh merged 1 commit intodevelopfrom Jan 27, 2026
Conversation
… results to Simulation" in combination with "Use as factor"
Contributor
Greptile OverviewGreptile SummaryThis PR fixes issue #2754 where Parameter Identification with "Use as Factor" was incorrectly applying the factor to the current parameter value instead of the initial value. Key Changes
Technical ImplementationThe fix introduces an Testing
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Engine as ParameterIdentificationEngine
participant PI as ParameterIdentification
participant IP as IdentificationParameter
participant PS as ParameterSelection
participant Param as IParameter
Note over Engine,Param: Parameter Identification Start
Engine->>PI: StartAsync()
Engine->>PI: CaptureIdentificationParameterInitialValues()
PI->>IP: CaptureLinkedParameterValues()
alt UseAsFactor = true
IP->>PS: Get Parameter.Value
PS->>Param: Value (e.g., 50)
Param-->>PS: 50
PS-->>IP: 50
IP->>PS: Set InitialValue = 50
else UseAsFactor = false
Note over IP: Skip capturing (not needed)
end
Note over Engine,Param: Optimization Runs...
Note over Param: Parameter may change during optimization
Note over Engine,Param: Transfer Results to Simulation
Engine->>IP: OptimizedParameterValueFor(optimalValue=10, linkedParameter)
alt UseAsFactor = true AND InitialValue exists
IP->>PS: Get InitialValue
PS-->>IP: 50 (captured value)
IP-->>Engine: 10 * 50 = 500
else UseAsFactor = true AND InitialValue is null
Note over IP: Fallback for backward compatibility
IP->>PS: Get Parameter.Value
PS-->>IP: Current value
IP-->>Engine: 10 * Current value
else UseAsFactor = false
IP-->>Engine: 10 (optimalValue)
end
|
rwmcintosh
commented
Jan 27, 2026
| if (linkedParameter.InitialValue.HasValue) | ||
| return optimalValue * linkedParameter.InitialValue.Value; | ||
|
|
||
| // Fall back to the old method if the PI was last run before this feature |
Member
Author
There was a problem hiding this comment.
I included this for projects where the PI has not run since the feature was introduced. It falls back to the old behavior.
Yuri05
approved these changes
Jan 27, 2026
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.
Fixes #2754
Description
When using use-as-factor we are going to capture the value of linked parameters when the PI is started and then use the captured value and factor rather than continuing to apply the factor to the current parameter value.
Type of change
Please mark relevant options with an
xin the brackets.How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Reviewer checklist
Mark everything that needs to be checked before merging the PR.
This change requires a documentation updateabove is selectedScreenshots (if appropriate):
Questions (if appropriate):