-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Broke setState into two functions so in future setStateModule can be implemented differently by different cell types * added divisions setter for use in future subclass make functions * added getCriticalRegionVolumes and Heights for use in future subclass cell constructors * changed parameter name to overcome HiddenFieldCheck error * added Javadoc comments on new getters and setters * changed parameter name in setStateModule to overcome hidden field error. Formatting fix. * added getter and setter tests. formatting fix * formatting fix * deleted getters/setters. Made necessary fields not public. Deleted associated tests * deleted unnecessary imports and formatting fix * made fields that alread had getters public so no elements of PottsCell constructor need to be accessed via getters * typo fix * deleted unnecessary import and formatting fix * made PottsCell abstract class. Made default cell type PottsCellStem. Changed PottsCell tests to be PottsCellStem tests. Changed PottsCellContainer to default to making PottsCellStem cells * fixed merge issues * Moved assignment of potts cell class when none specified to PottsSeries. Deleted abstract make in PottsCell. Casted to PottsCell in PottsModule * updated parameters mock to return stem when parameters.get(CLASS) is called * Moved PottsCell make, state, and module tests into PottsCellStemTest. Made mock implementation of PottsCell for PottsCellTest * added content to PottsSeriesTest to make sure class is set to stem as default and to a given string if a given string is provided * Finished adjusting PottsSeriesTest to test for default cell class being set * formatting fixes * Addressing Jessica's comments * formattig fixes * removing code comments * added ability to assign one real state to PottsCellMock for testing purposes * formatting fix * added mocks for PottsModule getPhase return in PottsCellTest tests * formatting * Fix minor formatting and move remaining make test to PottsCellStem --------- Co-authored-by: jessicasyu <[email protected]>
- Loading branch information
1 parent
f15f446
commit 1c6b1bb
Showing
9 changed files
with
395 additions
and
187 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
package arcade.potts.agent.cell; | ||
|
||
import java.util.EnumMap; | ||
import ec.util.MersenneTwisterFast; | ||
import arcade.core.agent.cell.CellState; | ||
import arcade.core.env.location.Location; | ||
import arcade.core.util.MiniBox; | ||
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.PottsModuleQuiescence; | ||
import static arcade.potts.util.PottsEnums.Region; | ||
import static arcade.potts.util.PottsEnums.State; | ||
|
||
/** | ||
* Extension of {@link PottsCell} for stem cells. | ||
* <p> | ||
* This is the default cell type for Potts models. | ||
*/ | ||
public final class PottsCellStem extends PottsCell { | ||
|
||
/** | ||
* Creates a {@code PottsCellStem} agent. | ||
* | ||
* @param id the cell ID | ||
* @param parent the parent ID | ||
* @param pop the cell population index | ||
* @param state the cell state | ||
* @param age the cell age | ||
* @param divisions the number of cell divisions | ||
* @param location the {@link Location} of the cell | ||
* @param hasRegions {@code true} if cell has regions, {@code false} otherwise | ||
* @param parameters the dictionary of parameters | ||
* @param criticalVolume the critical cell volume | ||
* @param criticalHeight the critical cell height | ||
* @param criticalRegionVolumes the map of critical volumes for regions | ||
* @param criticalRegionHeights the map of critical heights for regions | ||
*/ | ||
public PottsCellStem(int id, int parent, int pop, CellState state, int age, int divisions, | ||
Location location, boolean hasRegions, MiniBox parameters, | ||
double criticalVolume, double criticalHeight, | ||
EnumMap<Region, Double> criticalRegionVolumes, | ||
EnumMap<Region, Double> criticalRegionHeights) { | ||
super(id, parent, pop, state, age, divisions, location, hasRegions, parameters, | ||
criticalVolume, criticalHeight, criticalRegionVolumes, criticalRegionHeights); | ||
} | ||
|
||
@Override | ||
public PottsCell make(int newID, CellState newState, Location newLocation, | ||
MersenneTwisterFast random) { | ||
divisions++; | ||
return new PottsCellStem(newID, id, pop, newState, age, divisions, newLocation, | ||
hasRegions, parameters, criticalVolume, criticalHeight, | ||
criticalRegionVolumes, criticalRegionHeights); | ||
} | ||
|
||
@Override | ||
void setStateModule(CellState newState) { | ||
switch ((State) newState) { | ||
case QUIESCENT: | ||
module = new PottsModuleQuiescence(this); | ||
break; | ||
case PROLIFERATIVE: | ||
module = new PottsModuleProliferationSimple(this); | ||
break; | ||
case APOPTOTIC: | ||
module = new PottsModuleApoptosisSimple(this); | ||
break; | ||
case NECROTIC: | ||
module = new PottsModuleNecrosis(this); | ||
break; | ||
case AUTOTIC: | ||
module = new PottsModuleAutosis(this); | ||
break; | ||
default: | ||
// State must be one of the above cases. | ||
module = null; | ||
break; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.