CPMEvol
Extends:
Extension of the CPM class that uses Cell objects to track internal state of Cells Cell objects can override conf parameters, and track their lineage.
Constructor Summary
Public Constructor | ||
public |
constructor(field_size: GridSize, conf: object) The constructor of class CA. |
Member Summary
Public Members | ||
public |
Store the constructor of each cellKind on the grid, in order 0th index currently unused - but this is explicitly left open for further extension (granting background variable parameters through Cell) |
|
public |
Store the {@Cell} of each cell on the grid. |
Method Summary
Public Methods | ||
public |
Calls a birth event in a new daughter Cell object, and hands the other daughter (as parent) on to the Cell. |
|
public |
cellDeath(i: IndexCoordinate, t_old: CellId, t_new: CellId) The postSetpixListener of CPMEvol registers cell death. |
|
public | ||
public |
makeNewCellID(kind: CellKind): CellId |
|
public |
reset() Completely reset; remove all cells and set time back to zero. |
Inherited Summary
From class GridBasedModel | ||
public |
cellvolume: *[] This tracks the volumes of all non-background cells on the grid. |
|
public |
Input parameter settings; see the constructor of subclasses documentation. |
|
public |
Size of the grid. |
|
public |
Size of the grid in object format. |
|
public |
grid: * |
|
public |
Midpoint of the grid. |
|
public |
Attach a random number generation with a seed. |
|
public |
Dimensionality of the grid |
|
public |
The Grid2D#neighi or Grid3D#neighi iterator function of the underlying grid. |
|
public |
The Grid2D#pixels or Grid3D#pixels iterator function of the underlying grid. |
|
public |
The Grid#pixti iterator function of the underlying grid. |
|
public |
Cached values of these stats. |
|
public |
Objects of class Stat that have been computed on this model. |
|
public |
Tracks the elapsed time in MCS |
|
public |
Iterator for all the CellIds that are currently on the grid. |
|
public | ||
public |
Compute a statistic on this model. |
|
public |
neigh(p: ArrayCoordinate, torus: boolean[]): * Get neighbourhood of position p, using neighborhood functions of the underlying grid class. |
|
public |
pixt(p: ArrayCoordinate): CellId Get CellId of the pixel at coordinates p. |
|
public |
Get a random integer number between incl_min and incl_max, uniformly sampled. |
|
public |
Get a random number from the seeded number generator. |
|
public |
setpix(p: ArrayCoordinate, t: CellId) Change the pixel at position p into CellId t. |
|
public |
setpixi(i: IndexCoordinate, t: CellId) Change the pixel at position i into CellId t. |
|
public abstract |
timeStep() Update the grid in one timestep. |
From class CPM | ||
public get |
|
|
public |
track border pixels for speed |
|
public |
cellvolume: *[] |
|
public |
Array of objects of (@link HardConstraint) subclasses attached to the CPM. |
|
public |
Object showing which constraints are where in soft_constraints. |
|
public |
To check from outside if an object is a CPM; doing this with instanceof doesn't work in some cases. Any other object will not have this variable and return 'undefined', which in an if-statement equates to a 'false'. @type{boolean} |
|
public |
Highest cell ID previously assigned. |
|
public |
Number of non-background cells currently on the grid. |
|
public |
Array of functions that need to be executed after every timeStep event. |
|
public |
Array of functions that need to be executed after every setpixi event. |
|
public |
Array of objects of (@link SoftConstraint) subclasses attached to the CPM. |
|
public |
Object showing which constraints are where in soft_constraints. |
|
public |
stat_values: {} |
|
public |
Store the {@CellKind} of each cell on the grid. |
|
public |
Track time in MCS. |
|
private |
Private property used by updateborderneari to track borders. |
|
public |
add(t: Constraint) Add a constraint to the CPM, ensuring that its SoftConstraint#deltaH or HardConstraint#fulfilled methods are called appropriately during a copy attempt. |
|
public |
* cellBorderPixelIndices(): iPixel Iterator returning non-background border pixels on the grid. |
|
public |
* cellBorderPixels(): Pixel Iterator returning non-background border pixels on the grid. |
|
public | ||
public |
* cellPixels(): Pixel Iterator returning non-background pixels on the grid. |
|
public |
deltaH(sourcei: IndexCoordinate, targeti: IndexCoordinate, src_type: CellId, tgt_type: CellId): number returns total change in hamiltonian for all registered soft constraints together. |
|
public |
Determine whether copy attempt will succeed depending on deltaH (stochastic). |
|
public |
getAllConstraints(): * |
|
public |
getConstraint(constraintname: string, num: number): * Get a Constraint object linked to this CPM by the name of its class. |
|
public |
Get volume of the cell with CellId t |
|
public |
makeNewCellID(kind: CellKind): CellId |
|
public |
Simulate one Monte Carlo Step. |
|
public |
pixt(p: ArrayCoordinate): CellId Get CellId of the pixel at coordinates p. |
|
public |
reset() Completely reset; remove all cells and set time back to zero. |
|
public |
setCellKind(t: CellId, k: CellKind) |
|
public |
setpixi(i: IndexCoordinate, t: CellId) Change the pixel at position i into CellId t. |
|
public |
timeStep() A time step in the CPM is a Monte Carlo step. |
|
public |
updateborderneari(i: IndexCoordinate, t_old: CellId, t_new: CellId) Update border elements (borderpixels) after a successful copy attempt. |
Public Constructors
public constructor(field_size: GridSize, conf: object) source
The constructor of class CA.
Override:
CPM#constructorParams:
Name | Type | Attribute | Description |
field_size | GridSize | the size of the grid of the model. |
|
conf | object | configuration options; see CPM base class. |
|
conf.CELLS | object[] |
|
Array of objects of (@link Cell) subclasses attached to the CPM. These define the internal state of the cell objects that are tracked |
Public Members
public cellclasses: CellObject source
Store the constructor of each cellKind on the grid, in order 0th index currently unused - but this is explicitly left open for further extension (granting background variable parameters through Cell)
Public Methods
public birth(childId: CellId, parentId: CellId) source
Calls a birth event in a new daughter Cell object, and hands the other daughter (as parent) on to the Cell.
public cellDeath(i: IndexCoordinate, t_old: CellId, t_new: CellId) source
The postSetpixListener of CPMEvol registers cell death.
Params:
Name | Type | Attribute | Description |
i | IndexCoordinate | the coordinate of the pixel that is changed. |
|
t_old | CellId | the cellid of this pixel before the copy |
|
t_new | CellId | the cellid of this pixel after the copy. |
Listen:
as this records when cels no longer contain any pixels. Note: CPM class already logs most of death, so it registers deleted entries. |
public getCell(t: CellId): Cell source
Params:
Name | Type | Attribute | Description |
t | CellId | id of the cell to get kind of. |
public makeNewCellID(kind: CellKind): CellId source
Initiate a new CellId for a cell of CellKind "kind", and create elements for this cell in the relevant arrays. Overrides super to also add a new Cell object to track.
Override:
CPM#makeNewCellIDParams:
Name | Type | Attribute | Description |
kind | CellKind | cellkind of the cell that has to be made. |