Skip to content

Adding functionality to insert until confluence - #236

Merged
allison-li-1016 merged 12 commits into
mainfrom
allli/insert-confluence
Oct 5, 2026
Merged

allison-li-1016 merged 12 commits into
mainfrom
allli/insert-confluence

Conversation

@allison-li-1016

@allison-li-1016 allison-li-1016 commented Sep 21, 2026 •

Copy link
Copy Markdown
Contributor

Review time: s

Context: Currently insert only adds 1 cell per location. Certain cell types allow multiple cells to occupy the same location. I want to add the option to insert cells into the same location until the cell's density limit is reached.

Summary of changes:
Insert class

  • Added parameter for confluence option
  • Added loop to insert until max density is reached
  • Refactored cell initializing and adding into helper methods

PatchCell class

  • Added helper function to return max density per cell. We can discuss this implementation since technically max density should be per population not cell.
  • Made checkLocation public so other classes can cell the method. We would not need to do this if this method was refactored into the utils class instead, which I think is a WIP PR or Issue already (Factored checkLocationSpace into multiple methods in PatchUtilities #224)

Example usage:

<action id="INSERT_HIGH_DENSITY_TUMOR" class="insert">
     <action.parameter id="TIME_DELAY" value="0" />
     <action.parameter id="INSERT_NUMBER" value="3000" />
     <action.parameter id="INSERT_RADIUS" value="14" />
      <action.parameter id="CONFLUENCE" value="1" />
     <action.register id="cancer" />
 </action>

@allison-li-1016 allison-li-1016 self-assigned this Sep 21, 2026
@allison-li-1016
allison-li-1016 requested review from a team, Jannetty, afu5, cainja, daniellevahdat, jacob-evarts, jessicasyu and kristaphommatha and removed request for a team September 21, 2026 21:25
Comment thread src/arcade/patch/agent/action/PatchActionInsert.java
Comment thread test/arcade/patch/agent/action/PatchActionInsertTest.java
Comment thread test/arcade/patch/agent/action/PatchActionInsertTest.java Outdated
Comment thread test/arcade/patch/agent/action/PatchActionInsertTest.java

@Jannetty Jannetty left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Made some suggestions mostly for logging when the code defaults to something other than what the user specified. At some point I think it could be nice to have the ability to insert intermediate numbers of cells to each location (values other than 1 and the max), but I don't think that has to be in this PR. Great work!

@kristaphommatha kristaphommatha left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Just a small thing about the way the confluence parameter is read

Comment thread src/arcade/patch/agent/action/PatchActionInsert.java
Comment thread src/arcade/patch/agent/action/PatchActionInsert.java Outdated

@kristaphommatha kristaphommatha left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@allison-li-1016
allison-li-1016 merged commit 92e5961 into main Oct 5, 2026
7 checks passed
@allison-li-1016
allison-li-1016 deleted the allli/insert-confluence branch October 5, 2026 16:07
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.

3 participants