Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
816f7d0
logging with correct necrotic
pohaoc2 Mar 17, 2025
2bb3c09
adding combined t cell inflammation
cainja Apr 26, 2025
c579357
fixed replacement, added some more mechanisms
cainja Apr 28, 2025
2776fc7
added treat back
cainja Apr 29, 2025
c35bec4
fixed some changes
cainja May 14, 2025
08b736f
added all 4 logical cars circuits + refactoring
allison-li-1016 Jun 18, 2025
2ac0c1b
linting
allison-li-1016 Jun 18, 2025
16dd26e
adding documentation
allison-li-1016 Jun 18, 2025
58ea66a
adding leftover javadoc and variable casing fixes
allison-li-1016 Jun 18, 2025
8f49d20
updating javadoc and parameter description
allison-li-1016 Jun 18, 2025
34d21b7
simplfying binding event history logic
allison-li-1016 Jun 18, 2025
38fc568
decomplicating synnotch inactivation
allison-li-1016 Jun 30, 2025
e0c6fd2
removing unnecessary classes, adding enums in
allison-li-1016 Jul 2, 2025
51b115b
spotless linting
allison-li-1016 Jul 9, 2025
011f594
adding javadoc
allison-li-1016 Jul 9, 2025
95b9f8e
linting
allison-li-1016 Jul 9, 2025
2b26d40
adding more javadoc, moving TAU to final variable
allison-li-1016 Jul 9, 2025
80fe58d
once again, addressing linter issues
allison-li-1016 Jul 9, 2025
0b3a5b2
deleting unnecessary tags for unused params in javadoc
allison-li-1016 Jul 9, 2025
ddf1afc
spotlessApply
allison-li-1016 Jul 9, 2025
3090b06
reverting cd4 rule change
allison-li-1016 Jul 9, 2025
7590e7d
pushing carcade revisions to logicalCars
allison-li-1016 Jul 17, 2025
0f44fcd
debugging logical circuits
allison-li-1016 Jul 18, 2025
165090b
connecting synnotch antigens to actual tissue cells
allison-li-1016 Jul 22, 2025
f44dddf
Merge branch 'main' into allison/logical-cars-dev
allison-li-1016 Jul 22, 2025
872de39
updated version of model
allison-li-1016 Sep 23, 2025
d352492
Merge branch 'main' into allison/logical-cars-dev
allison-li-1016 Sep 23, 2025
80db62c
Merge remote-tracking branch 'origin/chiu/add-logging-cellCycle' into…
allison-li-1016 Sep 23, 2025
03556f8
added cell cycle tracking
allison-li-1016 Sep 24, 2025
c24df44
lysis location logging, proliferative antigen tracking, matrigel non-…
allison-li-1016 Nov 12, 2025
d64fd3d
new iCAR model
allison-li-1016 Feb 27, 2026
6309983
Merge remote-tracking branch 'origin/main' into allison/logical-cars-dev
allison-li-1016 Feb 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/arcade/patch/PatchARCADE.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public OutputSaver getSaver(Series series) {
PatchOutputSaver saver = new PatchOutputSaver(series);
saver.saveGraph = settings.contains("SAVE_GRAPH");
saver.saveLattice = settings.contains("SAVE_LAYERS");
saver.saveEvents = settings.contains("SAVE_EVENTS");
return saver;
}
}
3 changes: 2 additions & 1 deletion src/arcade/patch/agent/action/PatchActionConvert.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ public void step(SimState simstate) {
oldCell.getVolume(),
oldCell.getHeight(),
oldCell.getCriticalVolume(),
oldCell.getCriticalHeight());
oldCell.getCriticalHeight(),
oldCell.getCycles());
PatchCell newCell =
(PatchCell) cellContainer.convert(sim.cellFactory, location, sim.random);
grid.addObject(newCell, location);
Expand Down
150 changes: 150 additions & 0 deletions src/arcade/patch/agent/action/PatchActionReplace.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,150 @@
package arcade.patch.agent.action;

import java.util.ArrayList;
import java.util.logging.Logger;
import sim.engine.Schedule;
import sim.engine.SimState;
import sim.util.Bag;
import arcade.core.agent.action.Action;
import arcade.core.env.location.Location;
import arcade.core.sim.Series;
import arcade.core.sim.Simulation;
import arcade.core.util.MiniBox;
import arcade.core.util.Utilities;
import arcade.patch.agent.cell.PatchCell;
import arcade.patch.agent.cell.PatchCellContainer;
import arcade.patch.env.grid.PatchGrid;
import arcade.patch.env.location.Coordinate;
import arcade.patch.env.location.PatchLocationContainer;
import arcade.patch.sim.PatchSeries;
import arcade.patch.sim.PatchSimulation;
import static arcade.patch.util.PatchEnums.Ordering;

/**
* Implementation of {@link Action} for inserting cell agents.
*
* <p>The action is stepped once after {@code TIME_DELAY}. The action will insert a mixture of
* {@code INSERT_NUMBER} cells from each of the registered populations into locations within the
* specified radius {@code INSERT_RADIUS} from the center of the simulation.
*/
public class PatchActionReplace implements Action {
private static final Logger LOGGER = Logger.getLogger(PatchActionReplace.class.getName());

/** Time delay before calling the action [min]. */
private final int timeDelay;

/** Grid radius that cells are inserted into. */
private final int insertRadius;

/** Grid depth that cells are inserted into. */
private final int insertDepth;

/** Number of cells to insert from each population. */
private final int insertNumber;

/** List of populations. */
private final ArrayList<MiniBox> populations;

/**
* Creates a {@link Action} for removing cell agents.
*
* <p>Loaded parameters include:
*
* <ul>
* <li>{@code TIME_DELAY} = time delay before calling the action
* <li>{@code INSERT_RADIUS} = grid radius that cells are inserted into
* <li>{@code INSERT_NUMBER} = number of cells to insert from each population
* </ul>
*
* @param series the simulation series
* @param parameters the component parameters dictionary
*/
public PatchActionReplace(Series series, MiniBox parameters) {
int maxRadius = ((PatchSeries) series).radius;

// Set loaded parameters.
timeDelay = parameters.getInt("TIME_DELAY");
insertRadius = Math.min(maxRadius, parameters.getInt("INSERT_RADIUS"));
insertDepth = ((PatchSeries) series).depth;
insertNumber = parameters.getInt("INSERT_NUMBER");

// Initialize population register.
populations = new ArrayList<>();
LOGGER.info(
"Action Replace: "
+ parameters.getInt("TIME_DELAY")
+ " "
+ insertRadius
+ " "
+ insertNumber);
}

@Override
public void schedule(Schedule schedule) {
schedule.scheduleOnce(timeDelay, Ordering.ACTIONS.ordinal(), this);
}

@Override
public void register(Simulation sim, String population) {
populations.add(sim.getSeries().populations.get(population));
}

@Override
public void step(SimState simstate) {
PatchSimulation sim = (PatchSimulation) simstate;
PatchGrid grid = (PatchGrid) sim.getGrid();

// Select valid coordinates to insert into and shuffle.
ArrayList<Coordinate> coordinates =
sim.locationFactory.getCoordinates(insertRadius, insertDepth);
Utilities.shuffleList(coordinates, sim.random);

// Add cells from each population into insertion area.
for (MiniBox population : populations) {
int id = sim.getID();
int pop = population.getInt("CODE");

for (int i = 0; i < insertNumber; i++) {
if (coordinates.isEmpty()) {
break;
}

Coordinate coord = coordinates.remove(0);
PatchLocationContainer locationContainer = new PatchLocationContainer(id, coord);
PatchCellContainer tempContainer = sim.cellFactory.createCellForPopulation(id, pop);
Location tempLocation =
locationContainer.convert(sim.locationFactory, tempContainer);

Bag bag = (Bag) grid.getObjectAt(tempLocation.hashCode());

if (bag == null) {
continue;
}

// Select old cell and remove from simulation.
PatchCell oldCell = (PatchCell) bag.get(0);
Location location = oldCell.getLocation();
grid.removeObject(oldCell, oldCell.getLocation());
oldCell.stop();
// Create new cell and add to simulation.
PatchCellContainer cellContainer =
new PatchCellContainer(
oldCell.getID(),
oldCell.getParent(),
pop,
oldCell.getAge(),
oldCell.getDivisions(),
oldCell.getState(),
oldCell.getVolume(),
oldCell.getHeight(),
oldCell.getCriticalVolume(),
oldCell.getCriticalHeight(),
oldCell.getCycles());
PatchCell newCell =
(PatchCell) cellContainer.convert(sim.cellFactory, location, sim.random);
grid.addObject(newCell, location);
newCell.schedule(sim.getSchedule());
}
}
}
}
Loading
Loading