Skip to content

Commit

Permalink
revising bindTarget method such that only tissue cells are considered…
Browse files Browse the repository at this point in the history
… when searching for neighbors
  • Loading branch information
allison-li-1016 committed Jan 21, 2025
1 parent 642573d commit 42752a0
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/arcade/patch/agent/cell/PatchCellCART.java
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,10 @@ public PatchCellTissue bindTarget(
// get all agents from neighboring locations
for (Location neighborLocation : loc.getNeighbors()) {
Bag bag = new Bag(grid.getObjectsAtLocation(neighborLocation));
for (Object b : bag) {
// add all agents from neighboring locations
if (!allAgents.contains(b)) allAgents.add(b);
for (Object agent : bag) {
Cell cell = (Cell) agent;
// add all tissue agents from neighboring locations
if (cell instanceof PatchCellTissue) allAgents.add(cell);

Check failure on line 206 in src/arcade/patch/agent/cell/PatchCellCART.java

View workflow job for this annotation

GitHub Actions / checkstyle

[checkstyle] src/arcade/patch/agent/cell/PatchCellCART.java#L206 <com.puppycrawl.tools.checkstyle.checks.blocks.NeedBracesCheck>

'if' construct must use '{}'s.
Raw output
/github/workspace/./src/arcade/patch/agent/cell/PatchCellCART.java:206:17: error: 'if' construct must use '{}'s. (com.puppycrawl.tools.checkstyle.checks.blocks.NeedBracesCheck)
}
}

Expand Down Expand Up @@ -230,9 +231,7 @@ public PatchCellTissue bindTarget(
// Within maximum search vicinity, search for neighboring cells to bind to
for (int i = 0; i < maxSearch; i++) {
Cell cell = (Cell) allAgents.get(i);
if (!(cell instanceof PatchCellCART)
&& cell.getState() != State.APOPTOTIC
&& cell.getState() != State.NECROTIC) {
if (cell.getState() != State.APOPTOTIC && cell.getState() != State.NECROTIC) {
PatchCellTissue tissueCell = (PatchCellTissue) cell;
double cARAntigens = tissueCell.carAntigens;
double selfTargets = tissueCell.selfTargets;
Expand Down

0 comments on commit 42752a0

Please sign in to comment.