import ActivityMultiBackground from 'Artistoo/src/hamiltonian/ActivityMultiBackground.js'
public class | source

ActivityMultiBackground

Extends:

ConstraintSoftConstraintActivityConstraint → ActivityMultiBackground

The ActivityMultiBackground constraint implements the activity constraint of Potts models, but allows users to specify locations on the grid where LAMBDA_ACT is different. See ActivityConstraint for the normal version of this constraint. See ActivityMultiBackground#constructor for an explanation of the parameters.

Constructor Summary

Public Constructor
public

The constructor of the ActivityConstraint requires a conf object with parameters.

Member Summary

Public Members
public

Wrapper: select function to compute activities based on ACT_MEAN in conf.

public

Store which pixels belong to which background type

public

Activity of all cellpixels with a non-zero activity is stored in this object, with the IndexCoordinate of each pixel as key and its current activity as value.

public

Track if this.bgvoxels has been set.

Method Summary

Public Methods
public

This method checks that all required parameters are present in the object supplied to the constructor, and that they are of the right format.

public

deltaH(sourcei: IndexCoordinate, targeti: IndexCoordinate, src_type: CellId, tgt_type: CellId): number

Method to compute the Hamiltonian for this constraint.

public

setBackgroundVoxels(voxels: *)

Get the background voxels from input argument or the conf object and store them in a correct format in this.bgvoxels.

Inherited Summary

From class Constraint
public get abstract

This method is actually implemented in the subclass.

public set

CPM(C: CPM)

This function attaches the relevant CPM to this constraint, so that information about this cpm can be requested from the constraint.

public get

Get the parameters of this constraint from the conf object.

public

C: CPM

CPM on which this constraint acts.

public

Configuration object for this constraint.

public abstract

cellParameter(param: string, cid: CellId): any

Get a cellid or cellkind-specific parameter for a constraint.

public abstract

The optional confChecker method should verify that all the required conf parameters are actually present in the conf object and have the right format.

public

paramOfCell(param: string, cid: CellId): any

Get a cellId specific parameter, only used if CPMEvol is used: looks whether the requested parameter is overwritten in an @object Cell and otherwise returns @function paramOfKind

public

paramOfKind(param: string, cid: CellId): any

Returns a cellKind specfic variable: Assumes that the parameter is indexable by cellkind.

From class SoftConstraint
public get

Let the CPM know that this is a soft constraint, so return 'soft'.

public abstract

deltaH(src_i: IndexCoordinate, tgt_i: IndexCoordinate, src_type: CellId, tgt_type: CellId): number

Soft constraints must have a deltaH method to compute the Hamiltonian.

From class ActivityConstraint
public

Wrapper: select function to compute activities based on ACT_MEAN in conf.

public

Activity of all cellpixels with a non-zero activity is stored in this object, with the IndexCoordinate of each pixel as key and its current activity as value.

public

This method checks that all required parameters are present in the object supplied to the constructor, and that they are of the right format.

public

deltaH(sourcei: IndexCoordinate, targeti: IndexCoordinate, src_type: CellId, tgt_type: CellId): number

Method to compute the Hamiltonian for this constraint.

public

The postMCSListener of the ActivityConstraint ensures that pixel activities decline with one after every MCS.

public

The postSetpixListener of the ActivityConstraint ensures that pixels are given their maximal activity when they are freshly added to a CPM.

public

Current activity (under the Act model) of the pixel at position i.

private

Activity mean computation methods for arithmetic mean.

private

Activity mean computation methods for geometric mean.

Public Constructors

public constructor(conf: object) source

The constructor of the ActivityConstraint requires a conf object with parameters.

Override:

ActivityConstraint#constructor

Params:

NameTypeAttributeDescription
conf object

parameter object for this constraint

conf.ACT_MEAN string
  • optional
  • default: "geometric"

should local mean activity be measured with an "arithmetic" or a "geometric" mean?

conf.LAMBDA_ACT_MBG PerKindArray

strength of the activityconstraint per cellkind and per background.

conf.MAX_ACT PerKindNonNegative

how long do pixels remember their activity? Given per cellkind.

conf.BACKGROUND_VOXELS Array

an array where each element represents a different background type. This is again an array of {@ArrayCoordinate}s of the pixels belonging to that backgroundtype. These pixels will have the LAMBDA_ACT_MBG value of that backgroundtype, instead of the standard value.

Public Members

public activityAt: function source

Wrapper: select function to compute activities based on ACT_MEAN in conf. Default is to use the activityAtGeom for a geometric mean.

Override:

ActivityConstraint#activityAt

public bgvoxels: Array source

Store which pixels belong to which background type

public cellpixelsact: object source

Activity of all cellpixels with a non-zero activity is stored in this object, with the IndexCoordinate of each pixel as key and its current activity as value. When the activity reaches 0, the pixel is removed from the object until it is added again.

Override:

ActivityConstraint#cellpixelsact

public setup: boolean source

Track if this.bgvoxels has been set.

Public Methods

public confChecker() source

This method checks that all required parameters are present in the object supplied to the constructor, and that they are of the right format. It throws an error when this is not the case.

Override:

ActivityConstraint#confChecker

public deltaH(sourcei: IndexCoordinate, targeti: IndexCoordinate, src_type: CellId, tgt_type: CellId): number source

Method to compute the Hamiltonian for this constraint.

Override:

ActivityConstraint#deltaH

Params:

NameTypeAttributeDescription
sourcei IndexCoordinate

coordinate of the source pixel that tries to copy.

targeti IndexCoordinate

coordinate of the target pixel the source is trying to copy into.

src_type CellId

cellid of the source pixel.

tgt_type CellId

cellid of the target pixel.

Return:

number

the change in Hamiltonian for this copy attempt and this constraint.

public setBackgroundVoxels(voxels: *) source

Get the background voxels from input argument or the conf object and store them in a correct format in this.bgvoxels. This only has to be done once, but can be called from outside to change the background voxels during a simulation (eg in a HTML page).

Params:

NameTypeAttributeDescription
voxels *