Repository navigation
Conversation
recreate_sim_state() wrote the saved cycle-model and phase codes into model().code and current_phase().code. Both belong to the Cycle_Model that every cell of the type shares, so each cell read overwrote the codes for its whole type, and the cell itself never moved: it stayed on its definition's cycle model in phase index 0. Dead cells came back on their live cycle model with dead = 1, so apoptotic and necrotic cells were never removed and dead cells could divide. Match the saved codes instead. If the saved model is not the definition's cycle model, sync the cell onto the death model with that code, as Cell::start_death() does, without rerunning the death entry function (the saved volumes and rates already reflect it). Then set current_phase_index to the phase with the saved code. elapsed_time_in_phase is read afterward, so the sync does not reset it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Per review: instead of matching the saved cycle-model code against the definition's death models, use the saved dead flag and death model index, and drop the code-matching warnings. The phase code, elapsed time and exit rate are now kept in locals and restored in one place after the death state is read, since a dead cell's sync to its death model resets the cycle data. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The necrosis entry function sets rupture_volume from the cell's volume when it died, and cells.mat does not save it, so a resumed cell keeps its cell definition's value. Document the limitation until rupture_volume is saved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
recreate_sim_state()wrote each cell's saved cycle-model and phase codes intophenotype.cycle.model().codeandcurrent_phase().code. Both belong to theCycle_Modelshared by every cell of the type, so each cell read relabeled the shared model, while the cell itself never moved. It stayed on its definition's cycle model, in phase index 0. In a resumed run, dead cells therefore come back on their live cycle model withdeadset. Apoptotic and necrotic cells are never removed, and dead cells keep dividing into dead daughters. In multi-phase models, every live cell restarts in phase 0, which then carries the last-read cell's phase code.The reader now leaves the shared model alone. If the saved
deadflag is set, it syncs the cell onto its saved death model, asCell::start_death()does. It skips the death entry function, because the saved volumes and rates already reflect it. It then setscurrent_phase_indexto the phase with the saved code. The elapsed time and exit rate are restored after the sync, so the sync does not reset them. This changes the dynamics of any resumed run that has dead cells or a multi-phase cycle model.Same fix as drbergman#80.
🤖 Generated with Claude Code