Skip to content
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
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
6 changes: 3 additions & 3 deletions src/arcade/core/util/Vector.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public Vector(Double3D vector) {
* @return the x component
*/
public double getX() {
return vector.x;
return vector.getX();
}

/**
Expand All @@ -42,7 +42,7 @@ public double getX() {
* @return the y component
*/
public double getY() {
return vector.y;
return vector.getY();
}

/**
Expand All @@ -51,7 +51,7 @@ public double getY() {
* @return the z component
*/
public double getZ() {
return vector.z;
return vector.getZ();
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/arcade/potts/agent/cell/PottsCellFlyGMC.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
* Implementation of {@link PottsCell} for fly GMC agents. These cells divide into two {@link
* PottsCellFlyNeuron} cells. The links must be set in the setup file so that 100% of the daughter
* cells are Neurons. The differentiation of the parent cell is handled by the {@link
* PottsModuleFlyGMCDifferentiation} module. The basal apoptosis rate of this cell should be set to
* 0 in the setup file.
* PottsModuleProliferationVolumeBasedDivision} module. The basal apoptosis rate of this cell should
* be set to 0 in the setup file.
*/
public class PottsCellFlyGMC extends PottsCell {

Expand Down
4 changes: 2 additions & 2 deletions src/arcade/potts/agent/cell/PottsCellStem.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import arcade.potts.agent.module.PottsModuleApoptosisSimple;
import arcade.potts.agent.module.PottsModuleAutosis;
import arcade.potts.agent.module.PottsModuleNecrosis;
import arcade.potts.agent.module.PottsModuleProliferationSimple;
import arcade.potts.agent.module.PottsModuleProliferationCellCycleProgressionSimple;
import arcade.potts.agent.module.PottsModuleQuiescence;
import static arcade.potts.util.PottsEnums.Region;
import static arcade.potts.util.PottsEnums.State;
Expand Down Expand Up @@ -73,7 +73,7 @@ void setStateModule(CellState newState) {
module = new PottsModuleQuiescence(this);
break;
case PROLIFERATIVE:
module = new PottsModuleProliferationSimple(this);
module = new PottsModuleProliferationCellCycleProgressionSimple(this);
break;
case APOPTOTIC:
module = new PottsModuleApoptosisSimple(this);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
import arcade.potts.util.PottsEnums.State;

/**
* Implementation of {@link PottsModuleProliferationSimple} for fly GMC agents. These cells divide
* into two {@link PottsCellFlyNeuron} cells. The links must be set in the setup file so that 100%
* of the daughter cells are Neurons.
* Implementation of {@link PottsModuleProliferationVolumeBasedDivision} for fly GMC agents. These
* cells divide into two {@link PottsCellFlyNeuron} cells. The links must be set in the setup file
* so that 100% of the daughter cells are Neurons.
*/
public class PottsModuleFlyGMCDifferentiation extends PottsModuleProliferationSimple {
public class PottsModuleFlyGMCDifferentiation extends PottsModuleProliferationVolumeBasedDivision {

/**
* Creates a fly GMC proliferation module.
Expand All @@ -29,7 +29,15 @@ public PottsModuleFlyGMCDifferentiation(PottsCellFlyGMC cell) {
super(cell);
}

@Override
/**
* Adds a cell to the simulation.
*
* <p>The cell location is split. The new neuron cell is created, initialized, and added to the
* schedule. This cell's location is also assigned to a new Neuron cell.
*
* @param random the random number generator
* @param sim the simulation instance
*/
void addCell(MersenneTwisterFast random, Simulation sim) {
Potts potts = ((PottsSimulation) sim).getPotts();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
* <p>During proliferation, cells cycle through G1, S, G2, and M phases. Once the cell complete M
* phase, it divides to create a new daughter cell.
*/
public abstract class PottsModuleProliferation extends PottsModule {
public abstract class PottsModuleProliferationCellCycleProgression extends PottsModule {
/**
* Creates a proliferation {@code Module} for the given {@link PottsCell}.
*
* @param cell the {@link PottsCell} the module is associated with
*/
public PottsModuleProliferation(PottsCell cell) {
public PottsModuleProliferationCellCycleProgression(PottsCell cell) {
super(cell);
setPhase(Phase.PROLIFERATIVE_G1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
import static arcade.potts.util.PottsEnums.Region;
import static arcade.potts.util.PottsEnums.State;

/** Extension of {@link PottsModuleProliferation} with Poisson transitions. */
public class PottsModuleProliferationSimple extends PottsModuleProliferation {
/** Extension of {@link PottsModuleProliferationCellCycleProgression} with Poisson transitions. */
public class PottsModuleProliferationCellCycleProgressionSimple
extends PottsModuleProliferationCellCycleProgression {
/** Threshold for critical volume size checkpoint. */
static final double SIZE_CHECKPOINT = 0.95;

Expand Down Expand Up @@ -64,7 +65,7 @@ public class PottsModuleProliferationSimple extends PottsModuleProliferation {
*
* @param cell the {@link PottsCell} the module is associated with
*/
public PottsModuleProliferationSimple(PottsCell cell) {
public PottsModuleProliferationCellCycleProgressionSimple(PottsCell cell) {
super(cell);

Parameters parameters = cell.getParameters();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package arcade.potts.agent.module;

import ec.util.MersenneTwisterFast;
import arcade.core.sim.Simulation;
import arcade.core.util.Parameters;
import arcade.potts.agent.cell.PottsCell;
import arcade.potts.util.PottsEnums.Phase;

/**
* Implementation of {@link PottsModule} for fly GMC agents. These cells divide into two {@link
* PottsCellFlyNeuron} cells. The links must be set in the setup file so that 100% of the daughter
* cells are Neurons.
*/
public abstract class PottsModuleProliferationVolumeBasedDivision extends PottsModule {

/** Overall growth rate for cell (voxels/tick). */
final double cellGrowthRate;

/**
* Target ratio of critical volume for division size checkpoint (cell must reach CRITICAL_VOLUME
* * SIZE_TARGET * SIZE_CHECKPOINT to divide).
*/
final double sizeTarget;

/**
* Creates a proliferation module in which division is solely dependent on cell volume.
*
* @param cell the cell to which this module is attached
*/
public PottsModuleProliferationVolumeBasedDivision(PottsCell cell) {
super(cell);
Parameters parameters = cell.getParameters();
sizeTarget = parameters.getDouble("proliferation/SIZE_TARGET");
cellGrowthRate = parameters.getDouble("proliferation/CELL_GROWTH_RATE");
setPhase(Phase.UNDEFINED);
}

@Override
public void step(MersenneTwisterFast random, Simulation sim) {
cell.updateTarget(cellGrowthRate, sizeTarget);
boolean sizeCheck = cell.getVolume() >= sizeTarget * cell.getCriticalVolume();
if (sizeCheck) {
addCell(random, sim);
}
}

/**
* Adds a cell to the simulation.
*
* @param random the random number generator
* @param sim the simulation instance
*/
abstract void addCell(MersenneTwisterFast random, Simulation sim);
}
4 changes: 2 additions & 2 deletions test/arcade/potts/agent/cell/PottsCellStemTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import arcade.potts.agent.module.PottsModuleApoptosis;
import arcade.potts.agent.module.PottsModuleAutosis;
import arcade.potts.agent.module.PottsModuleNecrosis;
import arcade.potts.agent.module.PottsModuleProliferation;
import arcade.potts.agent.module.PottsModuleProliferationCellCycleProgression;
import arcade.potts.agent.module.PottsModuleQuiescence;
import arcade.potts.env.location.PottsLocation;
import static org.junit.jupiter.api.Assertions.*;
Expand Down Expand Up @@ -94,7 +94,7 @@ public void setState_givenState_updatesModule() {
assertTrue(cell.module instanceof PottsModuleQuiescence);

cell.setState(State.PROLIFERATIVE);
assertTrue(cell.module instanceof PottsModuleProliferation);
assertTrue(cell.module instanceof PottsModuleProliferationCellCycleProgression);

cell.setState(State.APOPTOTIC);
assertTrue(cell.module instanceof PottsModuleApoptosis);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,10 @@
import arcade.potts.util.PottsEnums.State;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.*;
import static arcade.potts.util.PottsEnums.Region;
import static arcade.potts.util.PottsEnums.State;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.mockConstruction;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

public class PottsModuleFlyGMCDifferentiationTest {
private int[][][] dummyIDs;
Expand Down Expand Up @@ -104,20 +105,7 @@ public final void setupMocks() {
when(gmcCell.getCriticalRegionVolumes()).thenReturn(critRegionVolumes);
when(gmcCell.getCriticalRegionHeights()).thenReturn(critRegionHeights);

// Stub parameters
parameters = mock(Parameters.class);
when(parameters.getDouble("proliferation/RATE_G1")).thenReturn(1.0);
when(parameters.getDouble("proliferation/RATE_S")).thenReturn(1.0);
when(parameters.getDouble("proliferation/RATE_G2")).thenReturn(1.0);
when(parameters.getDouble("proliferation/RATE_M")).thenReturn(1.0);
when(parameters.getInt("proliferation/STEPS_G1")).thenReturn(1);
when(parameters.getInt("proliferation/STEPS_S")).thenReturn(1);
when(parameters.getInt("proliferation/STEPS_G2")).thenReturn(1);
when(parameters.getInt("proliferation/STEPS_M")).thenReturn(1);
when(parameters.getDouble("proliferation/CELL_GROWTH_RATE")).thenReturn(1.0);
when(parameters.getDouble("proliferation/NUCLEUS_GROWTH_RATE")).thenReturn(1.0);
when(parameters.getDouble("proliferation/BASAL_APOPTOSIS_RATE")).thenReturn(0.1);
when(parameters.getDouble("proliferation/NUCLEUS_CONDENSATION_FRACTION")).thenReturn(0.5);
when(gmcCell.getParameters()).thenReturn(parameters);

random = mock(MersenneTwisterFast.class);
Expand Down Expand Up @@ -153,7 +141,8 @@ public void addCell_called_callsExpectedMethods() {
when(container.convert(eq(cellFactory), eq(newLocation), any(MersenneTwisterFast.class)))
.thenReturn(newCell);

PottsModuleFlyGMCDifferentiation module = new PottsModuleFlyGMCDifferentiation(gmcCell);
PottsModuleProliferationVolumeBasedDivision module =
new PottsModuleFlyGMCDifferentiation(gmcCell);
module.addCell(random, sim);
verify(location).split(random);
verify(gmcCell).reset(dummyIDs, dummyRegions);
Expand Down
Loading
Loading