Nemo  2.3.56
Simulate forward-in-time genetic evolution in a spatially explicit, individual-based stochastic simulator
LCEquanti.h
Go to the documentation of this file.
1
30#ifndef LCEQUANTI_H
31#define LCEQUANTI_H
32
33#include "LCEbreed.h"
34#include "ttquanti.h"
35
36//LCE_QuantiInit
37//
39class LCE_QuantiInit : public virtual LifeCycleEvent
40{
41
44 unsigned int _nTraits, _nLoci;
46
47public:
48
50
51 virtual ~LCE_QuantiInit ( ) { }
52
53 virtual void execute ();
54 void init_trait_value(sex_t SEX, age_idx AGE, unsigned int size, unsigned int deme, double *values);
55 void init_allele_freq(sex_t SEX, age_idx AGE, unsigned int size, unsigned int deme, double *values, double **all_val);
56
57 virtual LifeCycleEvent* clone ( ) {return new LCE_QuantiInit();}
58
59 virtual bool setParameters ();
60
61 //SimComponent implementation:
62 virtual void loadFileServices ( FileServices* loader ) {}
63 virtual void loadStatServices ( StatServices* loader ) {}
64 virtual bool resetParameterFromSource (std::string param, SimComponent* cmpt) {return false;}
65 virtual age_t removeAgeClass ( ) {return 0;}
66 virtual age_t addAgeClass ( ) {return 0;}
67 virtual age_t requiredAgeClass () {return 0;}
68
69};
70
71//LCE_QuantiModifier
72//
74class LCE_QuantiModifier : public virtual LifeCycleEvent
75{
76
78 /*A vector storing the target heritability of the trait(s).*/
79 vector<double> _h2;
80 /*An array to hold the multiple occurrences of the modifier.*/
82 /*The index of the next time the modifier must be called.*/
83 unsigned int _next_occurrence;
84 /*A flag to indicate whether the modifier is called at each generation.*/
86 /*A flag to indicate on which age class the modifier is applied.*/
88
89 vector<double> (TTQuantiSH::* _get_VA_func_ptr) (Patch*, const age_idx);
90
91
92public:
93
95
96 virtual ~LCE_QuantiModifier ( ) { }
97
98 virtual void execute ();
99
100 void setVefromVa (Patch* patch, age_idx AGE);
101
102 void setIndPhenotype (Patch* patch, sex_t SEX, age_idx AGE);
103
104
105 virtual LifeCycleEvent* clone ( ) {return new LCE_QuantiModifier();}
106
107 virtual bool setParameters ();
108
109 //SimComponent implementation:
110 virtual void loadFileServices ( FileServices* loader ) {}
111 virtual void loadStatServices ( StatServices* loader ) {}
112 virtual bool resetParameterFromSource (std::string param, SimComponent* cmpt) {return false;}
113 virtual age_t removeAgeClass ( ) {return 0;}
114 virtual age_t addAgeClass ( ) {return 0;}
115 virtual age_t requiredAgeClass () {return 0;}
116
117};
118
119// Class LCE_Breed_Quanti
120//
131class LCE_Breed_Quanti : public virtual LCE_Breed_base
132{
133
135 vector<double> _h2;
136
137 vector<double> (TTQuantiSH::* _get_VA_func_ptr) (Patch*, const age_idx);
138
140
141public:
142
143 LCE_Breed_Quanti ( ) : LifeCycleEvent("breed_quanti","quant"), _QuantiProto(0),
145
146 virtual ~LCE_Breed_Quanti ( ) { }
147
148 void setVefromVa (Patch* patch, age_idx AGE);
149
150 void setIndPhenotype (Patch* patch, sex_t SEX, age_idx AGE);
151
153
155
158 virtual bool setParameters ();
159 virtual void execute ();
160
161 virtual LifeCycleEvent* clone ( ) {return new LCE_Breed_Quanti();}
162
163 virtual void loadFileServices ( FileServices* loader ) {}
164 virtual void loadStatServices ( StatServices* loader ) {}
165 virtual bool resetParameterFromSource (std::string param, SimComponent* cmpt) {return false;}
166 virtual age_t removeAgeClass ( ) {return 0;}
167 virtual age_t addAgeClass ( ) {return OFFSPRG;}
168 virtual age_t requiredAgeClass () {return ADULTS;}
170};
171
172
173#endif
A class to manage the files associated with each components of the simulation.
Definition: fileservices.h:52
Implementation of the basic breeding and mating procedures, does not link to any trait.
Definition: LCEquanti.h:132
vector< double >(TTQuantiSH::* _get_VA_func_ptr)(Patch *, const age_idx)
Definition: LCEquanti.h:137
virtual ~LCE_Breed_Quanti()
Definition: LCEquanti.h:146
void setVefromVa(Patch *patch, age_idx AGE)
Definition: LCEquanti.cc:548
vector< double > _h2
Definition: LCEquanti.h:135
virtual age_t requiredAgeClass()
Definition: LCEquanti.h:168
TProtoQuanti * _QuantiProto
Definition: LCEquanti.h:134
LCE_Breed_Quanti()
Definition: LCEquanti.h:143
void setIndPhenotype(Patch *patch, sex_t SEX, age_idx AGE)
Definition: LCEquanti.cc:578
virtual bool setParameters()
Definition: LCEquanti.cc:387
virtual void loadStatServices(StatServices *loader)
Definition: LCEquanti.h:164
virtual void loadFileServices(FileServices *loader)
Definition: LCEquanti.h:163
void(LCE_Breed_Quanti::* _myPopModelFuncPtr)(void)
Definition: LCEquanti.h:139
virtual age_t addAgeClass()
Definition: LCEquanti.h:167
virtual age_t removeAgeClass()
Definition: LCEquanti.h:166
virtual bool resetParameterFromSource(std::string param, SimComponent *cmpt)
Definition: LCEquanti.h:165
virtual void execute()
Definition: LCEquanti.cc:411
void WrightFisherPopulation()
Definition: LCEquanti.cc:491
virtual LifeCycleEvent * clone()
Definition: LCEquanti.h:161
void NonWrightFisherPopulation()
Definition: LCEquanti.cc:433
Base class for the breeding (and mating) life cycle events.
Definition: LCEbreed.h:44
Set patch-specifiec initial genotypes values.
Definition: LCEquanti.h:40
virtual void execute()
Definition: LCEquanti.cc:103
virtual bool setParameters()
Definition: LCEquanti.cc:50
LCE_QuantiInit()
Definition: LCEquanti.cc:41
bool _doByAlleleFreq
Definition: LCEquanti.h:43
TProtoQuanti * _QuantiProto
Definition: LCEquanti.h:45
TMatrix _init_values
Definition: LCEquanti.h:42
bool _doByTraitValue
Definition: LCEquanti.h:43
void init_allele_freq(sex_t SEX, age_idx AGE, unsigned int size, unsigned int deme, double *values, double **all_val)
Definition: LCEquanti.cc:169
virtual age_t removeAgeClass()
Definition: LCEquanti.h:65
virtual bool resetParameterFromSource(std::string param, SimComponent *cmpt)
Definition: LCEquanti.h:64
void init_trait_value(sex_t SEX, age_idx AGE, unsigned int size, unsigned int deme, double *values)
Definition: LCEquanti.cc:152
virtual age_t addAgeClass()
Definition: LCEquanti.h:66
virtual LifeCycleEvent * clone()
Definition: LCEquanti.h:57
unsigned int _nLoci
Definition: LCEquanti.h:44
virtual age_t requiredAgeClass()
Definition: LCEquanti.h:67
unsigned int _nTraits
Definition: LCEquanti.h:44
virtual void loadFileServices(FileServices *loader)
Definition: LCEquanti.h:62
TMatrix _init_freq
Definition: LCEquanti.h:42
virtual ~LCE_QuantiInit()
Definition: LCEquanti.h:51
virtual void loadStatServices(StatServices *loader)
Definition: LCEquanti.h:63
Set patch-specifiec initial genotypes values.
Definition: LCEquanti.h:75
TMatrix _occurrences
Definition: LCEquanti.h:81
LCE_QuantiModifier()
Definition: LCEquanti.cc:221
virtual bool setParameters()
Definition: LCEquanti.cc:241
vector< double > _h2
Definition: LCEquanti.h:79
bool _is_permanent
Definition: LCEquanti.h:85
virtual LifeCycleEvent * clone()
Definition: LCEquanti.h:105
void setIndPhenotype(Patch *patch, sex_t SEX, age_idx AGE)
Definition: LCEquanti.cc:367
virtual void loadStatServices(StatServices *loader)
Definition: LCEquanti.h:111
virtual ~LCE_QuantiModifier()
Definition: LCEquanti.h:96
virtual void loadFileServices(FileServices *loader)
Definition: LCEquanti.h:110
age_t _age_flag
Definition: LCEquanti.h:87
unsigned int _next_occurrence
Definition: LCEquanti.h:83
vector< double >(TTQuantiSH::* _get_VA_func_ptr)(Patch *, const age_idx)
Definition: LCEquanti.h:89
virtual void execute()
Definition: LCEquanti.cc:297
virtual age_t requiredAgeClass()
Definition: LCEquanti.h:115
virtual age_t removeAgeClass()
Definition: LCEquanti.h:113
virtual bool resetParameterFromSource(std::string param, SimComponent *cmpt)
Definition: LCEquanti.h:112
TProtoQuanti * _QuantiProto
Definition: LCEquanti.h:77
void setVefromVa(Patch *patch, age_idx AGE)
Definition: LCEquanti.cc:344
virtual age_t addAgeClass()
Definition: LCEquanti.h:114
Base class of the Life Cycle Events, declares the LCE interface.
Definition: lifecycleevent.h:73
Second class in the metapopulation design structure, between the Metapop and Individual classes.
Definition: metapop.h:430
Interface to all basic components of a simulation (traits, life cycle events, pop,...
Definition: simcomponent.h:45
The Service class used to manage the StatHandler objects.
Definition: statservices.h:50
A class to handle matrix in params, coerces matrix into a vector of same total size.
Definition: tmatrix.h:49
TProtoQuanti.
Definition: ttquanti.h:113
Definition: ttquanti.h:257
sex_t
Sex types, males are always 0 and females 1!!
Definition: types.h:36
unsigned int age_t
Age class flags.
Definition: types.h:46
#define ADULTS
Adults age class flag (breeders).
Definition: types.h:54
#define OFFSPRG
Offspring age class flag.
Definition: types.h:50
age_idx
Array index of the age classes in the patch sizes and containers arrays.
Definition: types.h:41

Generated for Nemo v2.3.56 by  doxygen 1.9.0 -- Nemo is hosted on  Download Nemo

Locations of visitors to this page
Catalogued on GSR