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

Add support for linked populations in setup file #76

Merged
merged 16 commits into from
Oct 25, 2024

Conversation

jessicasyu
Copy link
Member

Adds support for specifying linked populations in the setup file:

<population id="A">
    <population.link id="B" weight="0.8" />
    <population.link id="C" weight="0.2" />
</population>
<population id="B">
    <population.link id="A" weight="1" />
    <population.link id="B" weight="1" />
    <population.link id="C" weight="1" />
</population>
<population id="C" />

Linked populations are converted to a GrabBag object, which allows you to randomly select a population from the bag with weighted probabilities. Cell agents can use linked populations to select their daughter cell population (if links are not set, the default is the same population).

In the above example:

  • cells in population A have:
    • 80% change of producing a daughter cell in population B
    • 20% chance of producing a daughter cell in population C
  • cells in population B have:
    • 33% chance of producing a daughter cell in population A
    • 33% chance of producing a daughter cell in population B
    • 33% chance of producing a daughter cell in population C
  • cells in population C have 100% chance of producing a daughter cell in population C

Part 3 (of 3) in refactor to enable more flexibility for switching between populations.

Target branch is currently #75 to show the differences, but would need to merge #74 and #75 first and then change the base branch to develop.

@jessicasyu jessicasyu added the type: feature Improvement or additions to the code base label Oct 21, 2024
@jessicasyu jessicasyu changed the title Feature/link populations Add support for linked populations in setup file Oct 21, 2024
Base automatically changed from feature/container-constructors to develop October 24, 2024 20:58
@Jannetty
Copy link
Member

resolves #72

@jessicasyu jessicasyu linked an issue Oct 24, 2024 that may be closed by this pull request
@Jannetty Jannetty merged commit 87cbd44 into develop Oct 25, 2024
5 checks passed
@Jannetty Jannetty deleted the feature/link-populations branch October 25, 2024 05:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature Improvement or additions to the code base
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add functionality to specify cell class transitions
2 participants