Software for simulating active matter dynamics
Go to the documentation of this file.
2 //------------------------------------------------------------------
3 // **MEDYAN** - Simulation Package for the Mechanochemical
4 // Dynamics of Active Networks, v3.1
5 //
6 // Copyright (2015-2016) Papoian Lab, University of Maryland
7 //
9 //
10 // See the MEDYAN web page for more information:
11 //
12 //------------------------------------------------------------------
14 #ifndef MEDYAN_Filament_h
15 #define MEDYAN_Filament_h
17 #include <vector>
18 #include <iostream>
19 #include <deque>
20 #include <cmath>
22 #include "common.h"
24 #include "Database.h"
25 #include "Histogram.h"
26 #include "Trackable.h"
27 #include "Composite.h"
30 class SubSystem;
31 class Cylinder;
32 class Bead;
46 class Filament : public Composite, public Trackable {
48 friend class Controller;
50 private:
53  deque<Cylinder*> _cylinderVector;
57  short _filType;
59  int _ID;
61  short _deltaPlusEnd = 0;
62  short _deltaMinusEnd = 0;
66  int _plusEndPosition = 0;
67  double _turnoverTime = 0;
72  static Histogram* _turnoverTimes;
76 public:
82  Filament(SubSystem* s, short filamentType,
83  vector<double>& position,
84  vector<double>& direction,
85  bool nucleation = false,
86  bool branch = false);
91  Filament(SubSystem* s, short filamentType,
92  vector<vector<double>>& position, int numBeads,
93  string projectionType = "PREDEFINED");
97  Filament(SubSystem* s, short filamentType)
98  : Trackable(), _subSystem(s), _filType(filamentType), _ID(_filaments.getID()) {}
102  ~Filament();
108  void extendPlusEnd(short plusEnd);
113  void extendMinusEnd(short minusEnd);
116  void extendPlusEnd(vector<double>& coordinates);
117  void extendMinusEnd(vector<double>& coordinates);
121  void retractPlusEnd();
124  void retractMinusEnd();
128  void polymerizePlusEnd();
131  void polymerizeMinusEnd();
135  void depolymerizePlusEnd();
138  void depolymerizeMinusEnd();
142  void nucleate(short plusEnd, short filament, short minusEnd);
147  Filament* sever(int cylinderPosition);
150  deque<Cylinder*>& getCylinderVector() {return _cylinderVector;}
153  void resetDeltaPlusEnd() {_deltaPlusEnd = 0;}
155  void resetDeltaMinusEnd() {_deltaMinusEnd = 0;}
159  short getDeltaPlusEnd() {return _deltaPlusEnd;}
165  int getID() {return _ID;}
168  int getType() {return _filType;}
171  Cylinder* getMinusEndCylinder() {return _cylinderVector.front();}
173  Cylinder* getPlusEndCylinder() {return _cylinderVector.back();}
177  virtual void addToSubSystem() { _filaments.addElement(this);}
179  virtual void removeFromSubSystem() {_filaments.removeElement(this);}
183  static const vector<Filament*>& getFilaments() {
184  return _filaments.getElements();
185  }
187  static int numFilaments() {
188  return _filaments.countElements();
189  }
194  vector<double> nextBeadProjection(Bead* b, double d, vector<double> director);
197  vector<vector<double>> straightFilamentProjection(vector<vector<double>>& v, int numBeads);
198  vector<vector<double>> zigZagFilamentProjection(vector<vector<double>>& v, int numBeads);
199  vector<vector<double>> arcFilamentProjection(vector<vector<double>>& v, int numBeads);
200  //Aravind 18 Feb 2016.
201  vector<vector<double>> predefinedFilamentProjection(vector<vector<double>>& v, int numBeads);
204  virtual void printSelf();
208  bool isConsistent();
211  static species_copy_t countSpecies(short filamentType, const string& name);
212 };
214 #endif
Filament(SubSystem *s, short filamentType)
This constructor is called when a filament is severed.
Definition: Filament.h:97
vector< T > & getElements()
Get all items in database.
Definition: Database.h:69
double _turnoverTime
Time since last turnover.
Definition: Filament.h:67
Used to initialize, manage, and run an entire simulation.
Definition: Controller.h:40
unsigned int species_copy_t
Species constants.
Definition: common.h:24
int getType()
Get type.
Definition: Filament.h:168
void depolymerizePlusEnd()
Depolymerization of a filament front, which moves the leading bead back one monomer length...
Definition: Filament.cpp:393
Filament * sever(int cylinderPosition)
Sever a filament at a given cylinder position.
Definition: Filament.cpp:478
SubSystem * _subSystem
SubSystem pointer.
Definition: Filament.h:55
vector< vector< double > > zigZagFilamentProjection(vector< vector< double >> &v, int numBeads)
Projection function, returns a vector of coordinates for bead creation.
Definition: Filament.cpp:596
virtual void printSelf()
Prints information about this node. Useful for debugging.
Definition: Filament.cpp:803
vector< vector< double > > arcFilamentProjection(vector< vector< double >> &v, int numBeads)
Projection function, returns a vector of coordinates for bead creation.
Definition: Filament.cpp:782
A collection class to hold instances of a given class.
Definition: Database.h:38
void resetDeltaMinusEnd()
Reset delta.
Definition: Filament.h:155
An abstract base class for a trackable object in the SubSystem.
Definition: Trackable.h:33
int _ID
Unique integer id of this filament.
Definition: Filament.h:59
virtual void addToSubSystem()
SubSystem management, inherited from Trackable.
Definition: Filament.h:178
void nucleate(short plusEnd, short filament, short minusEnd)
Initialize the nucleation of a new filament Initializes all chemical species in initial Cylinder...
Definition: Filament.cpp:452
bool isConsistent()
Check the consistency of the filament.
Definition: Filament.cpp:821
A container to store a MCylinder and CCylinder.
Definition: Cylinder.h:50
virtual void removeFromSubSystem()
SubSystem management, inherited from Trackable.
Definition: Filament.h:179
static int numFilaments()
Get the number of filaments in this system.
Definition: Filament.h:187
virtual size_t countSpecies() const override
Returns the number of Species being managed by this node and its descendent nodes.
Definition: Composite.h:120
Used to store data about connectivity of Cylinders and Beads.
Definition: Filament.h:46
short getDeltaPlusEnd()
Get delta.
Definition: Filament.h:160
static Database< Filament * > _filaments
Collection in SubSystem.
Definition: Filament.h:69
deque< Cylinder * > & getCylinderVector()
Get vector of cylinders that this filament contains.
Definition: Filament.h:150
vector< double > nextBeadProjection(Bead *b, double d, vector< double > director)
Projection function, returns a vector of coordinates for bead creation.
void removeElement(T elem)
Remove an element from the collection.
Definition: Database.h:58
The aggregating class for the Composite pattern.
Definition: Composite.h:42
short _deltaPlusEnd
Change in filament&#39;s cylinders at plus end since last snapshot.
Definition: Filament.h:61
void depolymerizeMinusEnd()
Same as depolymerization front, but moves the back bead forward one monomer length.
Definition: Filament.cpp:423
void retractMinusEnd()
Retraction of back of a cylinder.
Definition: Filament.cpp:299
vector< vector< double > > straightFilamentProjection(vector< vector< double >> &v, int numBeads)
Projection function, returns a vector of coordinates for bead creation.
Definition: Filament.cpp:575
A class to hold frequency of occurences in a general set of data.
Definition: Histogram.h:30
short getDeltaMinusEnd()
Get delta.
Definition: Filament.h:161
int _plusEndPosition
Position of plus end bead at last turnover.
Definition: Filament.h:66
void resetDeltaPlusEnd()
Reset delta.
Definition: Filament.h:154
vector< vector< double > > predefinedFilamentProjection(vector< vector< double >> &v, int numBeads)
Projection function, returns a vector of coordinates for bead creation.
Definition: Filament.cpp:799
deque< Cylinder * > _cylinderVector
Deque of cylinders.
Definition: Filament.h:53
void extendPlusEnd(short plusEnd)
Addition of a new cylinder.
Definition: Filament.cpp:177
static const vector< Filament * > & getFilaments()
Get all instances of this class from the SubSystem.
Definition: Filament.h:183
void polymerizePlusEnd()
Polymerization of a filament front, which moves the leading bead one monomer length.
Definition: Filament.cpp:335
void polymerizeMinusEnd()
Same as Polymerization front, but moves the back bead one monomer length, and updates cylinder parame...
Definition: Filament.cpp:364
short _filType
Filament type.
Definition: Filament.h:57
int countElements()
Count the number of objects in the collection.
Definition: Database.h:72
void extendMinusEnd(short minusEnd)
Same as extension front, but adds a new first cylinder with first bead = new bead and a second bead i...
Definition: Filament.cpp:223
void addElement(T elem)
Add an element to the collection.
Definition: Database.h:52
This destructor is called when a filament is to be removed from the system.
Definition: Filament.cpp:113
Cylinder * getPlusEndCylinder()
Get end cylinder.
Definition: Filament.h:173
Manages all Movables and Reactables.
Definition: SubSystem.h:57
Filament(SubSystem *s, short filamentType, vector< double > &position, vector< double > &direction, bool nucleation=false, bool branch=false)
This constructor creates a short filament, containing only two beads, at runtime. ...
Definition: Filament.cpp:42
Cylinder * getMinusEndCylinder()
Get end cylinder.
Definition: Filament.h:172
int getID()
Get ID.
Definition: Filament.h:165
void retractPlusEnd()
Retraction of front of a cylinder.
Definition: Filament.cpp:270
Represents a single coordinate between Cylinders, and holds forces needed for mechanical equilibratio...
Definition: Bead.h:49
short _deltaMinusEnd
Change in filament&#39;s cylinders at minus end since last snapshot.
Definition: Filament.h:63
static Histogram * _turnoverTimes
Histogram data.
Definition: Filament.h:73
static Histogram * getTurnoverTimes()
Get the turnover times.
Definition: Filament.h:191