Skip to content
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

Fix bug in reading in rules. #207

Merged
merged 2 commits into from
Jun 3, 2024

Conversation

drbergman
Copy link
Collaborator

Just needed to initialize the pointers in a better way for them to be passed across functions and objects. I won't pretend to understand why this works, only that it does work.

Just needed to initialize the pointers in a better way for them to be passed across functions and objects. I won't pretend to understand why this works, only that it does work.
@drbergman
Copy link
Collaborator Author

This is responsive to Issue #206

@drbergman
Copy link
Collaborator Author

And in case there was any concern, I did look at all members of Hypothesis_Rule that are set in the Default Constructor and confirmed that *pHR has those values. OK, technically, I didn't check for the std::vector<bool> or std::vector<std::string> ones since they don't have a built-in way to interface with <<.

My initial fix unsynched the rules_map and the rules members of Hypothesis_Ruleset. This meant that when add_signal is called, only the Hypothesis_Rule's pointed to by the rules_map were updated and not the Hypothesis_Rule's in the rules vector.

In this fix, the rules vector is now a vector of pointers to Hypothesis_Rules. See Lines 780 and 781 where both end up with the same (pointer) value stored.
@drbergman
Copy link
Collaborator Author

I have checked that with the second commit "Fixing the fix..." that the rules do in fact work, they are displayed as expected in standard output, and that it works on rules files that break PhysiCell currently.

@MathCancer MathCancer merged commit 5ea7a14 into MathCancer:development Jun 3, 2024
5 checks passed
@drbergman drbergman deleted the fix-rules-map-bug branch June 4, 2024 01:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants