MEDYAN  3.1
Software for simulating active matter dynamics
Filament.h
Go to the documentation of this file.
1 
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 //
8 // ALL RIGHTS RESERVED
9 //
10 // See the MEDYAN web page for more information:
11 // http://www.medyan.org
12 //------------------------------------------------------------------
13 
14 #ifndef MEDYAN_Filament_h
15 #define MEDYAN_Filament_h
16 
17 #include <vector>
18 #include <iostream>
19 #include <deque>
20 #include <cmath>
21 
22 #include "common.h"
23 
24 #include "Database.h"
25 #include "Histogram.h"
26 #include "Trackable.h"
27 #include "Composite.h"
28 
29 //FORWARD DECLARATIONS
30 class SubSystem;
31 class Cylinder;
32 class Bead;
33 
35 
46 class Filament : public Composite, public Trackable {
47 
48 friend class Controller;
49 
50 private:
53  deque<Cylinder*> _cylinderVector;
54 
56 
57  short _filType;
58 
59  int _ID;
60 
61  short _deltaPlusEnd = 0;
62  short _deltaMinusEnd = 0;
64 
66  int _plusEndPosition = 0;
67  double _turnoverTime = 0;
68 
70 
72  static Histogram* _turnoverTimes;
75 
76 public:
82  Filament(SubSystem* s, short filamentType,
83  vector<double>& position,
84  vector<double>& direction,
85  bool nucleation = false,
86  bool branch = false);
87 
91  Filament(SubSystem* s, short filamentType,
92  vector<vector<double>>& position, int numBeads,
93  string projectionType = "PREDEFINED");
94 
97  Filament(SubSystem* s, short filamentType)
98  : Trackable(), _subSystem(s), _filType(filamentType), _ID(_filaments.getID()) {}
99 
102  ~Filament();
103 
108  void extendPlusEnd(short plusEnd);
113  void extendMinusEnd(short minusEnd);
114 
116  void extendPlusEnd(vector<double>& coordinates);
117  void extendMinusEnd(vector<double>& coordinates);
118 
121  void retractPlusEnd();
124  void retractMinusEnd();
125 
128  void polymerizePlusEnd();
131  void polymerizeMinusEnd();
132 
135  void depolymerizePlusEnd();
138  void depolymerizeMinusEnd();
139 
142  void nucleate(short plusEnd, short filament, short minusEnd);
143 
147  Filament* sever(int cylinderPosition);
148 
150  deque<Cylinder*>& getCylinderVector() {return _cylinderVector;}
151 
153  void resetDeltaPlusEnd() {_deltaPlusEnd = 0;}
155  void resetDeltaMinusEnd() {_deltaMinusEnd = 0;}
157 
159  short getDeltaPlusEnd() {return _deltaPlusEnd;}
163 
165  int getID() {return _ID;}
166 
168  int getType() {return _filType;}
169 
171  Cylinder* getMinusEndCylinder() {return _cylinderVector.front();}
173  Cylinder* getPlusEndCylinder() {return _cylinderVector.back();}
175 
177  virtual void addToSubSystem() { _filaments.addElement(this);}
179  virtual void removeFromSubSystem() {_filaments.removeElement(this);}
181 
183  static const vector<Filament*>& getFilaments() {
184  return _filaments.getElements();
185  }
187  static int numFilaments() {
188  return _filaments.countElements();
189  }
192 
194  vector<double> nextBeadProjection(Bead* b, double d, vector<double> director);
196 
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);
203 
204  virtual void printSelf();
205 
208  bool isConsistent();
209 
211  static species_copy_t countSpecies(short filamentType, const string& name);
212 };
213 
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
~Filament()
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