Nemo  2.3.46
LCEdisperse.h
Go to the documentation of this file.
1 
29 #ifndef LCEDISPERSE_H
30 #define LCEDISPERSE_H
31 #include <vector>
32 #include "lifecycleevent.h"
33 #include "param.h"
34 
35 
39 class LCE_Disperse_base: public virtual LifeCycleEvent
40 {
41 
44  vector<unsigned int> _PropaguleTargets;
46  bool _isForward;
47 
50 
51  vector< vector<double> > _reducedDispMat[2];
52  vector< vector<double> > _reducedDispMatProba[2];
53 
54  string _prefix;
55 
56  friend class LCE_Disperse_ConstDisp;
57  friend class LCE_Disperse_EvolDisp;
58 
59 protected:
60  unsigned int _npatch;
61 
62 public:
63 
65 
67  virtual ~LCE_Disperse_base();
68 
69  bool setBaseParameters(string prefix);
70  void setParamPrefix (string pref) {_prefix = pref;}
71  void addParameters (string prefix, ParamUpdaterBase* updater);
72 
75  void set_isForward(bool val) {_isForward = val;}
78  void allocateDispMatrix (sex_t sex, unsigned int dim);
79  bool setDispMatrix();
80  bool setReducedDispMatrix();
81  bool updateDispMatrix();
85  bool setLatticeMatrix();
86  bool setBasicLatticeMatrix(int side, double phi_mal, double phi_fem, double disp_mal, double disp_fem);
87  bool setLatticeTorrusMatrix(int side, double disp_mal, double disp_fem, TMatrix* grid);
89  bool setLatticeReflectingMatrix(int side, TMatrix* grid);
91  unsigned int getMigrationPatchForward (sex_t SEX, unsigned int LocalPatch);
92  unsigned int getMigrationPatchBackward (sex_t SEX, unsigned int LocalPatch);
93  void setPropaguleTargets ( );
94  void swapPostDisp ( );
95  void reset_counters ( );
98  unsigned int getDispersalModel ( ) {return _disp_model;}
100  unsigned int getPropaguleTarget (unsigned int home) {return _PropaguleTargets[home];}
104 // virtual void init(Metapop* popPtr);
105  //virtual bool setParameters ( );
106  virtual void loadFileServices ( FileServices* loader ) {}
107  virtual void loadStatServices ( StatServices* loader ) {}
108  virtual age_t removeAgeClass ( ) {return NONE;}
109  virtual age_t addAgeClass ( ) {return NONE;}
110  virtual age_t requiredAgeClass () {return OFFSPRG;}
112 };
113 
125 {
127  void (LCE_Disperse_ConstDisp::* doPatchMigration) (sex_t SEX, unsigned int local_patch);
128 
129 public:
130 
131  LCE_Disperse_ConstDisp (); // : LifeCycleEvent ("disperse","") {}
133 
134  bool setParameters (string prefix);
135 
136  void Migrate ( );
137  void Migrate_propagule ( );
138  void MigratePatch (sex_t SEX, unsigned int LocalPatch);
139  void MigratePatch_AbsorbingBorder (sex_t SEX, unsigned int LocalPatch);
142 // virtual void init(Metapop* popPtr);
143  virtual bool setParameters () {return setParameters("dispersal");}
144  virtual void execute ();
145  virtual LifeCycleEvent* clone () {return new LCE_Disperse_ConstDisp();}
147 };
148 
149 
150 
152 
153 
154 public:
155  LCE_SeedDisp ();
156  virtual ~LCE_SeedDisp(){}
157  virtual bool setParameters () {return LCE_Disperse_ConstDisp::setParameters("seed_disp");}
158  virtual LifeCycleEvent* clone () {return new LCE_SeedDisp();}
159 };
160 
161 
162 
173 {
174 
176  unsigned int (LCE_Disperse_EvolDisp::* getAimedPatch) (unsigned int);
178 
179  unsigned int Migrate_Island (unsigned int home);
180  unsigned int Migrate_Island_Propagule (unsigned int home);
181  unsigned int Migrate_SteppingStone1D (unsigned int home);
182  void exec_evolmale ();
183  void exec_evolfemale ();
184  void exec_evol2sex ();
185  void evoldisp (sex_t SEX, int trait_link, double cost);
186  void fixdisp (sex_t SEX, double rate, double cost);
187 
189 
190 // typedef LifeCycleEvent< LCE_Disperse_EvolDisp > LCEDispEvol;
191 public:
192 
194 
196 
199 // virtual void init(Metapop* popPtr);
200  virtual bool setParameters ();
201  virtual void execute ();
202  virtual LifeCycleEvent* clone () {return new LCE_Disperse_EvolDisp();}
204 };
205 
206 #endif //LCEDISPERSE_H
207 
unsigned int getDispersalModel()
Definition: LCEdisperse.h:98
void(LCE_Disperse_EvolDisp::* exec)()
Definition: LCEdisperse.h:177
bool checkBackwardDispersalMatrix(TMatrix *mat)
Definition: LCEdisperse.cc:334
virtual LifeCycleEvent * clone()
Definition: LCEdisperse.h:202
void(LCE_Disperse_ConstDisp::* doMigration)(void)
Definition: LCEdisperse.h:126
unsigned int Migrate_Island(unsigned int home)
Definition: LCEdisperse.cc:1568
The Service class used to manage the StatHandler objects.
Definition: statservices.h:50
void evoldisp(sex_t SEX, int trait_link, double cost)
Definition: LCEdisperse.cc:1486
void Migrate()
Definition: LCEdisperse.cc:1219
int _disp_model
Definition: LCEdisperse.h:42
virtual void loadFileServices(FileServices *loader)
Definition: LCEdisperse.h:106
bool setLatticeTorrusMatrix(int side, double disp_mal, double disp_fem, TMatrix *grid)
Definition: LCEdisperse.cc:764
void addParameters(string prefix, ParamUpdaterBase *updater)
Definition: LCEdisperse.cc:62
bool setIsland_PropagulePool_Matrix()
Definition: LCEdisperse.cc:469
virtual ~LCE_SeedDisp()
Definition: LCEdisperse.h:156
unsigned int age_t
Age class flags.
Definition: types.h:46
double _fem_rate
Definition: LCEdisperse.h:45
void setPropaguleTargets()
Definition: LCEdisperse.cc:352
virtual age_t requiredAgeClass()
Definition: LCEdisperse.h:110
Base class of the ParamUpdater class used to handle the temporal parameter argument values...
Definition: param.h:300
void reset_counters()
Definition: LCEdisperse.cc:290
virtual ~LCE_Disperse_base()
Deallocates the disp matrix.
Definition: LCEdisperse.cc:53
TMatrix * _DispMatrix[2]
The sex-specific dispersal matrices, [0] for males, [1] for females, might be used as connectivity ma...
Definition: LCEdisperse.h:49
bool setBaseParameters(string prefix)
Definition: LCEdisperse.cc:81
void set_isForward(bool val)
Definition: LCEdisperse.h:75
void exec_evol2sex()
Definition: LCEdisperse.cc:1478
bool updateDispMatrix()
Definition: LCEdisperse.cc:265
virtual LifeCycleEvent * clone()
Definition: LCEdisperse.h:158
vector< unsigned int > _PropaguleTargets
Definition: LCEdisperse.h:44
unsigned int getPropaguleTarget(unsigned int home)
Definition: LCEdisperse.h:100
#define NONE
No age flag.
Definition: types.h:48
LCE_SeedDisp()
Definition: LCEdisperse.cc:1309
unsigned int _npatch
Definition: LCEdisperse.h:60
virtual ~LCE_Disperse_ConstDisp()
Definition: LCEdisperse.h:132
virtual bool setParameters()
Definition: LCEdisperse.h:143
virtual void execute()
Definition: LCEdisperse.cc:1428
double _mal_rate
Definition: LCEdisperse.h:45
void exec_evolmale()
Definition: LCEdisperse.cc:1470
int _fdisp_trait_link
Definition: LCEdisperse.h:188
sex_t
Sex types, males are always 0 and females 1!!
Definition: types.h:36
void exec_evolfemale()
Definition: LCEdisperse.cc:1462
void swapPostDisp()
Definition: LCEdisperse.cc:277
bool setDispMatrix()
Definition: LCEdisperse.cc:404
Definition: LCEdisperse.h:151
virtual bool setParameters()
Definition: LCEdisperse.h:157
unsigned int(LCE_Disperse_EvolDisp::* getAimedPatch)(unsigned int)
Definition: LCEdisperse.h:176
double _mal_cost
Definition: LCEdisperse.h:175
virtual bool setParameters()
Definition: LCEdisperse.cc:1345
void fixdisp(sex_t SEX, double rate, double cost)
Definition: LCEdisperse.cc:1527
A class to handle matrix in params, coerces matrix into a vector of same total size.
Definition: tmatrix.h:49
bool checkForwardDispersalMatrix(TMatrix *mat)
Definition: LCEdisperse.cc:315
The base class of the dispersal LCEs, all events move offspring to the post-dispersal patch container...
Definition: LCEdisperse.h:39
double _fem_cost
Definition: LCEdisperse.h:175
unsigned int Migrate_Island_Propagule(unsigned int home)
Definition: LCEdisperse.cc:1581
void MigratePatch(sex_t SEX, unsigned int LocalPatch)
Definition: LCEdisperse.cc:1253
virtual void execute()
Definition: LCEdisperse.cc:1193
virtual ~LCE_Disperse_EvolDisp()
Definition: LCEdisperse.h:195
bool setBasicLatticeMatrix(int side, double phi_mal, double phi_fem, double disp_mal, double disp_fem)
Definition: LCEdisperse.cc:649
void allocateDispMatrix(sex_t sex, unsigned int dim)
Definition: LCEdisperse.cc:305
void setParamPrefix(string pref)
Definition: LCEdisperse.h:70
virtual age_t addAgeClass()
Definition: LCEdisperse.h:109
virtual LifeCycleEvent * clone()
Definition: LCEdisperse.h:145
void(LCE_Disperse_ConstDisp::* doPatchMigration)(sex_t SEX, unsigned int local_patch)
Definition: LCEdisperse.h:127
int _mdisp_trait_link
Definition: LCEdisperse.h:188
LCE_Disperse_base()
Definition: LCEdisperse.cc:45
#define OFFSPRG
Offspring age class flag.
Definition: types.h:50
virtual age_t removeAgeClass()
Definition: LCEdisperse.h:108
vector< vector< double > > _reducedDispMat[2]
Definition: LCEdisperse.h:51
double getPropaguleProb()
Definition: LCEdisperse.h:99
unsigned int getMigrationPatchBackward(sex_t SEX, unsigned int LocalPatch)
Definition: LCEdisperse.cc:1121
bool setReducedDispMatrix()
The reduced dispersal matrix contains the indices of the patches to which each patch is connected...
Definition: LCEdisperse.cc:976
void Migrate_propagule()
Definition: LCEdisperse.cc:1245
bool setLatticeReflectingMatrix(int side, TMatrix *grid)
Definition: LCEdisperse.cc:874
A class to manage the files associated with each components of the simulation.
Definition: fileservices.h:51
bool setSteppingStone1DMatrix()
Definition: LCEdisperse.cc:519
bool _isForward
Definition: LCEdisperse.h:46
double _fixed_disp_rate
Definition: LCEdisperse.h:175
Dispersal event with constant dispersal rates.
Definition: LCEdisperse.h:124
double _disp_propagule_prob
Definition: LCEdisperse.h:43
Base class of the Life Cycle Events, declares the LCE interface.
Definition: lifecycleevent.h:72
bool setIsland_MigrantPool_Matrix()
Definition: LCEdisperse.cc:437
vector< vector< double > > _reducedDispMatProba[2]
Definition: LCEdisperse.h:52
LCE_Disperse_ConstDisp()
Definition: LCEdisperse.cc:1144
unsigned int Migrate_SteppingStone1D(unsigned int home)
Definition: LCEdisperse.cc:1597
virtual void loadStatServices(StatServices *loader)
Definition: LCEdisperse.h:107
void MigratePatch_AbsorbingBorder(sex_t SEX, unsigned int LocalPatch)
Definition: LCEdisperse.cc:1278
bool setLatticeAbsorbingMatrix()
Definition: LCEdisperse.cc:918
bool setLatticeMatrix()
Sets the dispersal matrices for the Lattice dispersal model.
Definition: LCEdisperse.cc:606
LCE_Disperse_EvolDisp()
Definition: LCEdisperse.cc:1327
Dispersal event with an evolving dispersal rate given by the "disp" trait.
Definition: LCEdisperse.h:172
unsigned int getMigrationPatchForward(sex_t SEX, unsigned int LocalPatch)
Definition: LCEdisperse.cc:1102
string _prefix
Definition: LCEdisperse.h:54

Generated for Nemo v2.3.0 by  doxygen 1.8.8 --
Catalogued on GSR