MEDYAN  3.1
Software for simulating active matter dynamics
Linker Class Reference

A container to store a MLinker and CLinker. More...

#include <Linker.h>

Inheritance diagram for Linker:
Collaboration diagram for Linker:

Public Member Functions

 Linker (Cylinder *c1, Cylinder *c2, short linkerType, double position1=0.5, double position2=0.5)
 
virtual ~Linker () noexcept
 
void setCLinker (CLinker *cLinker)
 Set chem linker. More...
 
CLinkergetCLinker ()
 Get chem linker. More...
 
MLinkergetMLinker ()
 Get mech linker. More...
 
float getBirthTime ()
 Get the birth time. More...
 
virtual void updatePosition ()
 Update the position, inherited from Movable. More...
 
virtual void updateReactionRates ()
 Update the reaction rates, inherited from Reactable. More...
 
virtual void printSelf ()
 Prints information about this node. Useful for debugging. More...
 
virtual bool apply (Visitor &v)
 When this function is applied to a ConditionalVisitor v, the corresponding v.visit(this) is called, and v is further applied to all children of this node recursively. More...
 
virtual bool apply (SpeciesVisitor &v)
 Implements the apply_if() method of the Component class by recursively applying it to itself and all its children that contain Species. More...
 
virtual bool apply (ReactionVisitor &v)
 Implements the apply_if() method of the Component class by recursively applying it to itself and all its children that contain ReactionBase. More...
 
virtual bool apply_impl (SpeciesVisitor &v)
 Applies SpeciesVisitor v to every Species* object directly owned by this node. More...
 
virtual bool apply_impl (ReactionVisitor &v)
 Applies ReactionBaseVisitor v to every ReactionBase* object directly owned by this node. More...
 
CompositegetParent ()
 Returns the pointer to the parent node. More...
 
void setParent (Composite *other)
 Sets the parent of this node to other. More...
 
bool isRoot () const
 Returns true if this node is the root node. More...
 
CompositegetRoot ()
 Returns the root node of the hieararchy to which this node belongs to. More...
 
virtual size_t numberOfChildren () const
 Returns the number of children of this node. More...
 
virtual bool isComposite () const
 Returns true if this node is a Composite node. More...
 
virtual bool isSpeciesContainer () const
 Returns true if this node contains non-zero number of Species. More...
 
virtual bool isReactionsContainer () const
 Returns true if this node contains non-zero number of reactions (i.e. More...
 
virtual size_t numberOfSpecies () const
 Returns the number of Species being immediately managed by this node (i.e. More...
 
virtual size_t numberOfReactions () const
 Returns the number of ReactionBase objets being immediately managed by this node (i.e. More...
 
virtual string getFullName () const
 Return a string indicating the full name of this node (presumably used mainly for debugging) More...
 
virtual size_t countDescendents () const
 Return the total number of nodes contained under this node's hieararchy. More...
 
virtual size_t countSpecies () const
 Return the number of Species contained under this node's hieararchy. More...
 
virtual size_t countReactions () const
 Return the number of ReactionBase objects contained under this node's hieararchy. More...
 
CylindergetFirstCylinder ()
 Get attached cylinder. More...
 
CylindergetSecondCylinder ()
 Get attached cylinder. More...
 
double getFirstPosition ()
 Position management. More...
 
void setFirstPosition (double position1)
 Position management. More...
 
double getSecondPosition ()
 Position management. More...
 
void setSecondPosition (double position2)
 Position management. More...
 
virtual int getType ()
 Get linker parameter. More...
 
int getID ()
 Get linker parameter. More...
 
virtual void addToSubSystem ()
 SubSystem management, inherited from Trackable. More...
 
virtual void removeFromSubSystem ()
 SubSystem management, inherited from Trackable. More...
 

Static Public Member Functions

static const vector< Linker * > & getLinkers ()
 Get all instances of this class from the SubSystem. More...
 
static int numLinkers ()
 Get the number of linkers in this system. More...
 
static HistogramgetLifetimes ()
 Get the lifetimes. More...
 
static species_copy_t countSpecies (const string &name)
 Count the number of linker species with a given name in the system. More...
 

Public Attributes

vector< double > coordinate
 coordinate of midpoint, updated with updatePosition() More...
 

Protected Attributes

bool _movable
 Object type. More...
 
bool _reactable
 Object type. More...
 
bool _dneighbor
 Object type. More...
 
bool _neighbor
 Object type. More...
 

Static Protected Attributes

static SubSystem_subSystem = 0
 A subsystem pointer for every trackable. More...
 

Private Member Functions

void updateCoordinate ()
 Helper to get coordinate. More...
 

Private Attributes

unique_ptr< MLinker_mLinker
 Pointer to mech linker. More...
 
unique_ptr< CLinker_cLinker
 Pointer to chem linker. More...
 
Cylinder_c1
 First cylinder the linker is bound to. More...
 
Cylinder_c2
 Second cylinder the linker is bound to. More...
 
double _position1
 Position on first cylinder. More...
 
double _position2
 Position on second cylinder. More...
 
short _linkerType
 Integer specifying the type. More...
 
int _linkerID
 Integer ID of this specific linker, managed by Database. More...
 
float _birthTime
 
Compartment_compartment
 Birth time. More...
 

Static Private Attributes

static Database< Linker * > _linkers
 Collection in SubSystem. More...
 
static vector< LinkerRateChanger * > _unbindingChangers
 For dynamic rate unbinding. More...
 
static Histogram_lifetimes
 Histogram data. More...
 

Friends

class Controller
 
class DRController
 

Detailed Description

A container to store a MLinker and CLinker.

Linker class is used to manage and store a MLinker and CLinker. Upon intialization, both of these components are created.

Extending the Movable class, the positions of all instances can be updated by the SubSystem.

Extending the Reactable class, the reactions associated with all instances can be updated by the SubSystem.

Definition at line 46 of file Linker.h.

Constructor & Destructor Documentation

§ Linker()

Linker::Linker ( Cylinder c1,
Cylinder c2,
short  linkerType,
double  position1 = 0.5,
double  position2 = 0.5 
)

§ ~Linker()

Linker::~Linker ( )
virtualnoexcept
Note
- tracks lifetime data here

Definition at line 83 of file Linker.cpp.

References _birthTime, _lifetimes, Histogram::addValue(), Histogram::getMax(), Histogram::getMin(), and tau().

Member Function Documentation

§ addToSubSystem()

virtual void Linker::addToSubSystem ( )
inlinevirtual

SubSystem management, inherited from Trackable.

Implements Trackable.

Definition at line 125 of file Linker.h.

Referenced by getBirthTime().

§ apply() [1/3]

bool Component::apply ( Visitor v)
virtualinherited

When this function is applied to a ConditionalVisitor v, the corresponding v.visit(this) is called, and v is further applied to all children of this node recursively.

However, the ConditionalVisitor allows the visit() function to be applied only selectively to nodes that conform to specific criteria.

Reimplemented in Composite.

Definition at line 26 of file Component.cpp.

References Visitor::visit().

Referenced by Component::~Component().

§ apply() [2/3]

virtual bool Component::apply ( SpeciesVisitor v)
inlinevirtualinherited

Implements the apply_if() method of the Component class by recursively applying it to itself and all its children that contain Species.

Reimplemented in Composite.

Definition at line 61 of file Component.h.

References Component::apply_impl().

§ apply() [3/3]

virtual bool Component::apply ( ReactionVisitor v)
inlinevirtualinherited

Implements the apply_if() method of the Component class by recursively applying it to itself and all its children that contain ReactionBase.

Reimplemented in Composite.

Definition at line 69 of file Component.h.

References Component::apply_impl().

§ apply_impl() [1/2]

virtual bool Component::apply_impl ( SpeciesVisitor v)
inlinevirtualinherited

Applies SpeciesVisitor v to every Species* object directly owned by this node.

This method needs to be overriden by descendent classes that contain Species.

Reimplemented in Compartment.

Definition at line 65 of file Component.h.

Referenced by Component::apply(), and Composite::apply().

§ apply_impl() [2/2]

virtual bool Component::apply_impl ( ReactionVisitor v)
inlinevirtualinherited

Applies ReactionBaseVisitor v to every ReactionBase* object directly owned by this node.

This method needs to be overriden by descendent classes that contain ReactionBase.

Reimplemented in Compartment.

Definition at line 74 of file Component.h.

§ countDescendents()

virtual size_t Component::countDescendents ( ) const
inlinevirtualinherited

Return the total number of nodes contained under this node's hieararchy.

Note
This is a recursive call, and all nodes under this node are visited.

Reimplemented in Composite.

Definition at line 118 of file Component.h.

§ countReactions()

virtual size_t Component::countReactions ( ) const
inlinevirtualinherited

Return the number of ReactionBase objects contained under this node's hieararchy.

Note
This is a recursive call, and all nodes under this node are visited.

Reimplemented in Composite.

Definition at line 126 of file Component.h.

References Component::getType(), and Component::printSelf().

§ countSpecies() [1/2]

virtual size_t Component::countSpecies ( ) const
inlinevirtualinherited

Return the number of Species contained under this node's hieararchy.

Note
This is a recursive call, and all nodes under this node are visited.

Reimplemented in Composite.

Definition at line 122 of file Component.h.

Referenced by getLifetimes(), MotorGhost::getWalkLengths(), BranchingPoint::numBranchingPoints(), and Chemistry::print().

§ countSpecies() [2/2]

species_copy_t Linker::countSpecies ( const string &  name)
static

Count the number of linker species with a given name in the system.

Definition at line 201 of file Linker.cpp.

References _lifetimes, _linkers, _unbindingChangers, Database< T >::getElements(), and SpeciesNamesDB::removeUniqueFilName().

§ getBirthTime()

float Linker::getBirthTime ( )
inline

Get the birth time.

Definition at line 121 of file Linker.h.

References _birthTime, Database< T >::addElement(), and addToSubSystem().

§ getCLinker()

CLinker* Linker::getCLinker ( )
inline

Get chem linker.

Definition at line 100 of file Linker.h.

§ getFirstCylinder()

Cylinder* Linker::getFirstCylinder ( )
inline

Get attached cylinder.

Definition at line 93 of file Linker.h.

§ getFirstPosition()

double Linker::getFirstPosition ( )
inline

Position management.

Definition at line 107 of file Linker.h.

Referenced by getMLinker().

§ getFullName()

virtual string Component::getFullName ( ) const
inlinevirtualinherited

Return a string indicating the full name of this node (presumably used mainly for debugging)

Reimplemented in Compartment, CompartmentGrid, and Composite.

Definition at line 114 of file Component.h.

§ getID()

int Linker::getID ( )
inline

Get linker parameter.

Definition at line 117 of file Linker.h.

References _linkerID.

§ getLifetimes()

static Histogram* Linker::getLifetimes ( )
inlinestatic

Get the lifetimes.

Definition at line 139 of file Linker.h.

References _lifetimes, Component::countSpecies(), printSelf(), updatePosition(), and updateReactionRates().

Referenced by LinkerLifetimes::print().

§ getLinkers()

§ getMLinker()

MLinker* Linker::getMLinker ( )
inline

Get mech linker.

Definition at line 103 of file Linker.h.

References _position1, and getFirstPosition().

§ getParent()

§ getRoot()

Composite * Component::getRoot ( )
inherited

Returns the root node of the hieararchy to which this node belongs to.

Definition at line 19 of file Component.cpp.

References Component::getParent(), Component::getRoot(), and Component::isRoot().

Referenced by Component::getRoot(), ReactionBase::getRoot(), Species::getRoot(), and Component::isRoot().

§ getSecondCylinder()

Cylinder* Linker::getSecondCylinder ( )
inline

Get attached cylinder.

Definition at line 94 of file Linker.h.

References _c2.

§ getSecondPosition()

double Linker::getSecondPosition ( )
inline

Position management.

Definition at line 110 of file Linker.h.

References _position2.

§ getType()

virtual int Linker::getType ( )
inlinevirtual

Get linker parameter.

Implements Component.

Definition at line 116 of file Linker.h.

Referenced by setSecondPosition().

§ isComposite()

virtual bool Component::isComposite ( ) const
inlinevirtualinherited

Returns true if this node is a Composite node.

Reimplemented in Composite.

Definition at line 95 of file Component.h.

§ isReactionsContainer()

virtual bool Component::isReactionsContainer ( ) const
inlinevirtualinherited

Returns true if this node contains non-zero number of reactions (i.e.

ReactionBase pointers)

Reimplemented in Compartment.

Definition at line 102 of file Component.h.

Referenced by Composite::countReactions().

§ isRoot()

bool Component::isRoot ( ) const
inlineinherited

Returns true if this node is the root node.

A root node has no parent, and the corresponding getParent() call would return a nullptr.

Definition at line 85 of file Component.h.

References Component::getRoot().

Referenced by Component::getRoot().

§ isSpeciesContainer()

virtual bool Component::isSpeciesContainer ( ) const
inlinevirtualinherited

Returns true if this node contains non-zero number of Species.

Reimplemented in Compartment.

Definition at line 98 of file Component.h.

Referenced by Composite::countSpecies().

§ numberOfChildren()

virtual size_t Component::numberOfChildren ( ) const
inlinevirtualinherited

Returns the number of children of this node.

Note
Species and ReactionBase objects are not counted.

Reimplemented in Composite.

Definition at line 92 of file Component.h.

§ numberOfReactions()

virtual size_t Component::numberOfReactions ( ) const
inlinevirtualinherited

Returns the number of ReactionBase objets being immediately managed by this node (i.e.

not counting reactions belonging to children nodes, etc.

Reimplemented in Compartment, and Composite.

Definition at line 110 of file Component.h.

§ numberOfSpecies()

virtual size_t Component::numberOfSpecies ( ) const
inlinevirtualinherited

Returns the number of Species being immediately managed by this node (i.e.

not counting Species belonging to children nodes, etc.

Reimplemented in Compartment, and Composite.

Definition at line 106 of file Component.h.

§ numLinkers()

static int Linker::numLinkers ( )
inlinestatic

Get the number of linkers in this system.

Definition at line 134 of file Linker.h.

References Database< T >::countElements().

Referenced by BasicSnapshot::print(), BirthTimes::print(), Forces::print(), Tensions::print(), WallTensions::print(), and Types::print().

§ printSelf()

void Linker::printSelf ( )
virtual

Prints information about this node. Useful for debugging.

Implements Component.

Definition at line 167 of file Linker.cpp.

References _birthTime, _c1, _c2, _cLinker, _linkerID, _linkerType, _position1, _position2, coordinate, and Cylinder::printSelf().

Referenced by getLifetimes(), Linker(), updatePosition(), and LinkerFF::whoIsCulprit().

§ removeFromSubSystem()

virtual void Linker::removeFromSubSystem ( )
inlinevirtual

SubSystem management, inherited from Trackable.

Implements Trackable.

Definition at line 126 of file Linker.h.

References Database< T >::removeElement().

§ setCLinker()

void Linker::setCLinker ( CLinker cLinker)
inline

Set chem linker.

Definition at line 98 of file Linker.h.

Referenced by updatePosition().

§ setFirstPosition()

void Linker::setFirstPosition ( double  position1)
inline

Position management.

Definition at line 108 of file Linker.h.

§ setParent()

void Component::setParent ( Composite other)
inlineinherited

Sets the parent of this node to other.

Definition at line 81 of file Component.h.

§ setSecondPosition()

void Linker::setSecondPosition ( double  position2)
inline

Position management.

Definition at line 111 of file Linker.h.

References _linkerType, and getType().

§ updateCoordinate()

void Linker::updateCoordinate ( )
private

Helper to get coordinate.

Definition at line 29 of file Linker.cpp.

References mathfunc::midPointCoordinate().

Referenced by Linker(), and updatePosition().

§ updatePosition()

void Linker::updatePosition ( )
virtual

§ updateReactionRates()

void Linker::updateReactionRates ( )
virtual

Update the reaction rates, inherited from Reactable.

Note
- The function uses the linker's stretching force at the current state to change this rate. Does not consider compression forces, only stretching.

Implements Reactable.

Definition at line 147 of file Linker.cpp.

References _cLinker, _linkerType, _mLinker, _unbindingChangers, ReactionBase::getBareRate(), SysParams::RUNSTATE, ReactionBase::setRate(), and ReactionBase::updatePropensity().

Referenced by getLifetimes().

Friends And Related Function Documentation

§ Controller

friend class Controller
friend

Definition at line 48 of file Linker.h.

§ DRController

friend class DRController
friend

Definition at line 49 of file Linker.h.

Member Data Documentation

§ _birthTime

float Linker::_birthTime
private

Definition at line 64 of file Linker.h.

Referenced by getBirthTime(), printSelf(), and ~Linker().

§ _c1

Cylinder* Linker::_c1
private

First cylinder the linker is bound to.

Definition at line 55 of file Linker.h.

Referenced by Linker(), printSelf(), and updatePosition().

§ _c2

Cylinder* Linker::_c2
private

Second cylinder the linker is bound to.

Definition at line 56 of file Linker.h.

Referenced by getSecondCylinder(), Linker(), printSelf(), and updatePosition().

§ _cLinker

unique_ptr<CLinker> Linker::_cLinker
private

Pointer to chem linker.

Definition at line 53 of file Linker.h.

Referenced by Linker(), printSelf(), updatePosition(), and updateReactionRates().

§ _compartment

Compartment* Linker::_compartment
private

Birth time.

Where this linker is

Definition at line 66 of file Linker.h.

Referenced by Linker(), and updatePosition().

§ _dneighbor

bool Trackable::_dneighbor
protectedinherited

Object type.

Definition at line 54 of file Trackable.h.

§ _lifetimes

Histogram * Linker::_lifetimes
staticprivate

Histogram data.

Definition at line 73 of file Linker.h.

Referenced by countSpecies(), getLifetimes(), and ~Linker().

§ _linkerID

int Linker::_linkerID
private

Integer ID of this specific linker, managed by Database.

Definition at line 62 of file Linker.h.

Referenced by getID(), and printSelf().

§ _linkers

Database< Linker * > Linker::_linkers
staticprivate

Collection in SubSystem.

Definition at line 68 of file Linker.h.

Referenced by countSpecies().

§ _linkerType

short Linker::_linkerType
private

Integer specifying the type.

Definition at line 61 of file Linker.h.

Referenced by printSelf(), setSecondPosition(), and updateReactionRates().

§ _mLinker

unique_ptr<MLinker> Linker::_mLinker
private

Pointer to mech linker.

Definition at line 52 of file Linker.h.

Referenced by Linker(), updatePosition(), and updateReactionRates().

§ _movable

bool Trackable::_movable
protectedinherited

Object type.

Definition at line 52 of file Trackable.h.

§ _neighbor

bool Trackable::_neighbor
protectedinherited

Object type.

Definition at line 55 of file Trackable.h.

§ _position1

double Linker::_position1
private

Position on first cylinder.

Definition at line 58 of file Linker.h.

Referenced by getMLinker(), printSelf(), and updatePosition().

§ _position2

double Linker::_position2
private

Position on second cylinder.

Definition at line 59 of file Linker.h.

Referenced by getSecondPosition(), printSelf(), and updatePosition().

§ _reactable

bool Trackable::_reactable
protectedinherited

Object type.

Definition at line 53 of file Trackable.h.

§ _subSystem

SubSystem * Trackable::_subSystem = 0
staticprotectedinherited

A subsystem pointer for every trackable.

Definition at line 46 of file Trackable.h.

Referenced by Controller::Controller(), and BranchingPoint::~BranchingPoint().

§ _unbindingChangers

vector< LinkerRateChanger * > Linker::_unbindingChangers
staticprivate

For dynamic rate unbinding.

Definition at line 77 of file Linker.h.

Referenced by countSpecies(), DRController::initialize(), and updateReactionRates().

§ coordinate

vector<double> Linker::coordinate

coordinate of midpoint, updated with updatePosition()

Definition at line 83 of file Linker.h.

Referenced by Linker(), printSelf(), and updatePosition().


The documentation for this class was generated from the following files: