Skip to content

Commit

Permalink
Update substrate term parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
jessicasyu committed Oct 3, 2023
1 parent 2603c56 commit bb295dc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion src/arcade/potts/parameter.potts.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

<!-- substrate term parameters -->
<potts.term term="substrate" id="HEIGHT_THRESHOLD" value="9" units="um" conversion="DS^-1" />
<potts.term term="substrate" id="ADHESION" value="2" />
<potts.term term="substrate" id="ADHESION" value="5" />

<!-- persistence term parameters -->
<potts.term term="persistence" id="LAMBDA" value="0.01" conversion="DS^-2" />
Expand Down
25 changes: 12 additions & 13 deletions src/arcade/potts/sim/hamiltonian/SubstrateHamiltonian.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public class SubstrateHamiltonian implements Hamiltonian {
static final int NUMBER_NEIGHBORS = 9;

/** Scaling at threshold height. */
static final double THRESHOLD_FRACTION = 0.001;
static final double THRESHOLD_FRACTION = 0.01;

/** Map of hamiltonian config objects. */
final HashMap<Integer, SubstrateHamiltonianConfig> configs;
Expand Down Expand Up @@ -62,9 +62,9 @@ public void deregister(PottsCell cell) {
/**
* {@inheritDoc}
* <p>
* Substrate energy is calculated by summing across substrate voxels
* bordering the given voxel. Change in adhesion energy is taken as the
* difference in substrate energies for the source and target IDs.
* Substrate energy is calculated by summing across substrate voxels below
* the given voxel. Change in adhesion energy is taken as the difference in
* substrate energies for the source and target IDs.
*/
@Override
public double getDelta(int sourceID, int targetID, int x, int y, int z) {
Expand All @@ -87,9 +87,9 @@ public double getDelta(int id, int sourceRegion, int targetRegion, int x, int y,
/**
* Gets substrate energy for a given voxel.
* <p>
* Substrate is assumed to be located at z = 0. Media (id = 0) and cells not
* located adjacent to z = 0 (i.e. z == 1) return zero for substrate
* energy.
* Substrate is assumed to be located at z = 0. Media (id = 0) returns zero
* for substrate energy. Substrate energy is scaled by distance from z = 0
* by a power function.
*
* @param id the voxel id
* @param x the x coordinate
Expand All @@ -102,18 +102,17 @@ public double getDelta(int id, int sourceRegion, int targetRegion, int x, int y,
return 0;
}

SubstrateHamiltonianConfig config = configs.get(id);
double substrate = configs.get(id).getSubstrate();
double substrateEnergy = 0;

double s = 0;
for (int i = x - 1; i <= x + 1; i++) {
for (int j = y - 1; j <= y + 1; j++) {
s += -substrates[i][j] * config.getSubstrate();
substrateEnergy -= substrates[i][j];
}
}

s = Math.pow(z, power) * s / NUMBER_NEIGHBORS;

return s;
substrateEnergy = Math.pow(z, power) * substrateEnergy / NUMBER_NEIGHBORS * substrate;
return substrateEnergy;
}

/**
Expand Down

0 comments on commit bb295dc

Please sign in to comment.