Home Manual Reference Source Test
public class | source

Constraint

This base class defines a general CPM constraint and provides methods that do not depend on the specific constraint used. This class is never used on its own, as it does not yet contain the actual definition of a constraint (such as a deltaH method).

In general, we distinguish between two types of constraint:

  • a HardConstraint is a hard rule that must be fulfilled in order for a copy attempt to succeed;
  • a SoftConstraint is an energy term in the Hamiltonian that can make a copy attempt either more or less energetically favourable, but does not by itself determine whether a copy attempt will succeed. An unfavourable outcome may be outbalanced by favourable energies from other terms, and even a copy attempt net unfavourable energy (deltaH > 0) may succeed with a success chance P = exp(-DeltaH/T).

See the subclasses SoftConstraint and HardConstraint for details. Each implemented constraint is in turn a subclass of one of these two.

Constructor Summary

Public Constructor
public abstract

The constructor of a constraint takes a configuration object.

Member Summary

Public Members
public

C: CPM

CPM on which this constraint acts.

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

Configuration object for this constraint.

public get

Get the parameters of this constraint from the conf object.

Method Summary

Public Methods
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 Constructors

public abstract constructor(conf: object) source

The constructor of a constraint takes a configuration object. This method is usually overwritten by the actual constraint so that the entries of this object can be documented.

Params:

NameTypeAttributeDescription
conf object

configuration settings for this constraint, containing the relevant parameters.

Public Members

public C: CPM source

CPM on which this constraint acts.

public get abstract CONSTRAINT_TYPE source

This method is actually implemented in the subclass.

public set CPM(C: CPM) source

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

TODO:

  • Check why some constraints overwrite this? Because that disables the automatic usage of a confChecker() when it is implemented.

public conf: object source

Configuration object for this constraint.

public get parameters: object: * source

Get the parameters of this constraint from the conf object.

Return:

object

conf - configuration settings for this constraint, containing the relevant parameters.

Public Methods

public abstract confChecker() source

The optional confChecker method should verify that all the required conf parameters are actually present in the conf object and have the right format. It is implemented in the subclass that specifies the actual constraint.