Nemo  2.3.56
Simulate forward-in-time genetic evolution in a spatially explicit, individual-based stochastic simulator
TProtoBDMI Class Reference

#include <ttbdmi.h>

+ Inheritance diagram for TProtoBDMI:
+ Collaboration diagram for TProtoBDMI:

Public Member Functions

 TProtoBDMI ()
 
 TProtoBDMI (const TProtoBDMI &TP)
 
virtual ~TProtoBDMI ()
 
int get_nb_locus ()
 
double get_mut_rate ()
 
bool isHaploid ()
 
void set_init_freq (double *val, unsigned int size)
 
double get_init_freq (unsigned int i)
 
bool isInitSet ()
 
double getGenoFitnessHaplo (unsigned int row, unsigned int pos)
 
double getGenoFitnessDiplo (unsigned int row, unsigned int posA, unsigned int posB)
 
double getGenoFitnessDiplo (unsigned int row, unsigned int pos)
 
void setGenoFitnessValue (unsigned int row, unsigned int geno, double value)
 
void showGenoTable (unsigned int nrows)
 
void inherit (sex_t SEX, bitstring *seq, bitstring **parent)
 
Implementations


virtual void init ()
 
virtual TTraithatch ()
 
virtual TraitPrototypeclone ()
 
virtual trait_t get_type () const
 
virtual void store_data (BinaryStorageBuffer *saver)
 
virtual bool retrieve_data (BinaryStorageBuffer *reader)
 
virtual bool setParameters ()
 
virtual void loadFileServices (FileServices *loader)
 
virtual void loadStatServices (StatServices *loader)
 
virtual bool resetParameterFromSource (std::string param, SimComponent *cmpt)
 
- Public Member Functions inherited from TTProtoWithMap
 TTProtoWithMap ()
 
 TTProtoWithMap (const TTProtoWithMap &TP)
 
virtual ~TTProtoWithMap ()
 
void setMapIndex (unsigned int idx)
 
unsigned int getMapIndex ()
 
bool setGeneticMapParameters (string prefix)
 
void addGeneticMapParameters (string prefix)
 
bool setRecombinationMapRandom ()
 
bool setRecombinationMapNonRandom (vector< vector< double > > *lociPositions)
 
bool setRecombinationMapFixed ()
 
bool setNumLociPerChromosome (string param_name)
 
void reset_recombination_pointers ()
 
void registerGeneticMap ()
 
void unregisterFromGeneticMap ()
 
bool areGeneticMapParamSet (string prefix)
 
bool isRecombinationFree (string prefix)
 
void recordRandomMap ()
 
virtual void reset ()
 
- Public Member Functions inherited from TraitPrototype
virtual void reset ()=0
 Called at the end of a simulation to reset the Traits' prototypes (e.g. More...
 
virtual TTraithatch ()=0
 Creates the trait of which it is the prototype, called by IndFactory::makePrototype(). More...
 
virtual TraitPrototypeclone ()=0
 Returns a copy of itself. More...
 
virtual trait_t get_type () const =0
 Type accessor. More...
 
virtual void set_index (int idx)
 Sets the traits index. More...
 
virtual int get_index ()
 Index getter. More...
 
- Public Member Functions inherited from StorableComponent
virtual void store_data (BinaryStorageBuffer *saver)=0
 Interface to store the component data (e.g. gene values) into a binary buffer. More...
 
virtual bool retrieve_data (BinaryStorageBuffer *reader)=0
 Interface to retrieve the same data from the binary buffer. More...
 
virtual ~StorableComponent ()
 
- Public Member Functions inherited from SimComponent
 SimComponent ()
 
virtual ~SimComponent ()
 
virtual void loadUpdaters (UpdaterServices *loader)
 Loads the parameters and component updater onto the updater manager. More...
 
virtual void set_paramset (ParamSet *paramset)
 Sets the ParamSet member. More...
 
virtual void set_paramset (std::string name, bool required, SimComponent *owner)
 Sets a new ParamSet and name it. More...
 
virtual void set_paramsetFromCopy (const ParamSet &PSet)
 Reset the set of parameters from a another set. More...
 
virtual ParamSetget_paramset ()
 ParamSet accessor. More...
 
virtual void add_parameter (Param *param)
 Interface to add a parameter to the set. More...
 
virtual void add_parameter (std::string Name, param_t Type, bool isRequired, bool isBounded, double low_bnd, double up_bnd)
 Interface to add a parameter to the set. More...
 
virtual void add_parameter (std::string Name, param_t Type, bool isRequired, bool isBounded, double low_bnd, double up_bnd, ParamUpdaterBase *updater)
 Interface to add a parameter and its updater to the set. More...
 
virtual Paramget_parameter (std::string name)
 Param getter. More...
 
virtual double get_parameter_value (std::string name)
 Param value getter. More...
 
virtual string get_name ()
 Returnd the name of the ParamSet, i.e. More...
 
virtual bool has_parameter (std::string name)
 Param getter. More...
 

Private Attributes

trait_t _type
 
bool _isHaploid
 
unsigned int _nb_locus
 
double _mut_rate
 
double _genomic_mut_rate
 
double _recomb_rate
 
double * _init_freq
 
bool _isInitSet
 
void(TT_BDMI::* _inherit_func_ptr )(TTrait *, TTrait *)
 
void(TT_BDMI::* _mutation_func_ptr )(void)
 
double(TT_BDMI::* _viability_func_ptr )(void)
 
TMatrix_genoTable
 
TTBDMI_SH_stater
 
TTBDMI_FH_writer
 

Static Private Attributes

static unsigned int _diploGenotTableCoding [3][3] = {{0,1,2},{3,4,5},{6,7,8}}
 

Additional Inherited Members

- Static Public Member Functions inherited from TTProtoWithMap
static void recombine (unsigned long indID)
 
- Static Public Attributes inherited from TTProtoWithMap
static GeneticMap _map
 
- Protected Attributes inherited from TTProtoWithMap
unsigned int _mapIndex
 
double _totRecombEventsMean
 
double _recombRate
 
double _mapResolution
 
unsigned int _numChromosome
 
unsigned int _numLoci
 
double * _recombRatePerChrmsm
 
unsigned int_numLociPerChrmsm
 
unsigned int_chrsmLength
 
unsigned int_lociMapPositions
 
- Protected Attributes inherited from TraitPrototype
int _index
 The trait index in the Individual traits table. More...
 
- Protected Attributes inherited from SimComponent
ParamSet_paramSet
 The parameters container. More...
 

Constructor & Destructor Documentation

◆ TProtoBDMI() [1/2]

TProtoBDMI::TProtoBDMI ( )
39 :
42_genoTable(0), _writer(0), _stater(0)
43{
44 set_paramset("dmi", false, this);
45
46 add_parameter("dmi_loci",INT,true,false, 0, 0);
47 add_parameter("dmi_is_haploid",BOOL,false,false, 0, 0);
48 add_parameter("dmi_mutation_rate",DBL,true,true, 0, 1, 0);
49 add_parameter("dmi_genot_table", MAT, true, 0, 0, 0);
50
51 //genetic map parameters:
53
54 add_parameter("dmi_save_genotype", BOOL, false, false, 0, 0, 0);
55 add_parameter("dmi_logtime", INT, false, false, 0, 0);
56 add_parameter("dmi_output_dir", STR, false, false, 0, 0);
57
58}
virtual void set_paramset(ParamSet *paramset)
Sets the ParamSet member.
Definition: simcomponent.h:86
virtual void add_parameter(Param *param)
Interface to add a parameter to the set.
Definition: simcomponent.h:112
bool _isHaploid
Definition: ttbdmi.h:54
double * _init_freq
Definition: ttbdmi.h:59
double _recomb_rate
Definition: ttbdmi.h:58
void(TT_BDMI::* _inherit_func_ptr)(TTrait *, TTrait *)
Definition: ttbdmi.h:63
TTBDMI_FH * _writer
Definition: ttbdmi.h:69
trait_t _type
Definition: ttbdmi.h:52
double _mut_rate
Definition: ttbdmi.h:56
double(TT_BDMI::* _viability_func_ptr)(void)
Definition: ttbdmi.h:65
bool _isInitSet
Definition: ttbdmi.h:60
TMatrix * _genoTable
Definition: ttbdmi.h:67
void(TT_BDMI::* _mutation_func_ptr)(void)
Definition: ttbdmi.h:64
TTBDMI_SH * _stater
Definition: ttbdmi.h:68
unsigned int _nb_locus
Definition: ttbdmi.h:55
void addGeneticMapParameters(string prefix)
Definition: ttrait_with_map.cc:77
@ DBL
Definition: types.h:78
@ MAT
Definition: types.h:78
@ BOOL
Definition: types.h:78
@ STR
Definition: types.h:78
@ INT
Definition: types.h:78

References SimComponent::add_parameter(), TTProtoWithMap::addGeneticMapParameters(), BOOL, DBL, INT, MAT, SimComponent::set_paramset(), and STR.

Referenced by clone().

+ Here is the caller graph for this function:

◆ TProtoBDMI() [2/2]

TProtoBDMI::TProtoBDMI ( const TProtoBDMI TP)
62 :
66_genoTable(0), _writer(0), _stater(0)
67{
68 _paramSet = new ParamSet( *TP._paramSet );
69
70 if(TP._genoTable)
71 _genoTable = new TMatrix( *TP._genoTable );
72 else
73 _genoTable = NULL;
74
75}
Parameters container, implemented in each SimComponent.
Definition: param.h:206
ParamSet * _paramSet
The parameters container.
Definition: simcomponent.h:48
A class to handle matrix in params, coerces matrix into a vector of same total size.
Definition: tmatrix.h:49

References _genoTable, and SimComponent::_paramSet.

◆ ~TProtoBDMI()

TProtoBDMI::~TProtoBDMI ( )
virtual
80{
81 if(_genoTable) delete _genoTable; if(_stater) delete _stater; if(_writer) delete _writer;
82 if(_init_freq) delete [] _init_freq;
83}

References _genoTable, _init_freq, _stater, and _writer.

Member Function Documentation

◆ clone()

virtual TraitPrototype * TProtoBDMI::clone ( )
inlinevirtual

Implements TraitPrototype.

111{return new TProtoBDMI(*this);}
TProtoBDMI()
Definition: ttbdmi.cc:39

References TProtoBDMI().

◆ get_init_freq()

double TProtoBDMI::get_init_freq ( unsigned int  i)
inline
81{return _init_freq[i];}

References _init_freq.

Referenced by TT_BDMI::init_sequence().

+ Here is the caller graph for this function:

◆ get_mut_rate()

double TProtoBDMI::get_mut_rate ( )
inline
78{return _mut_rate;}

References _mut_rate.

◆ get_nb_locus()

int TProtoBDMI::get_nb_locus ( )
inline

◆ get_type()

virtual trait_t TProtoBDMI::get_type ( ) const
inlinevirtual

Implements TraitPrototype.

112{return _type;}

References _type.

Referenced by TT_BDMI::get_type(), and TT_BDMI::operator==().

+ Here is the caller graph for this function:

◆ getGenoFitnessDiplo() [1/2]

double TProtoBDMI::getGenoFitnessDiplo ( unsigned int  row,
unsigned int  pos 
)
inline
95 {
96 assert(pos < 9);
97 return _genoTable->get(row, pos);
98 }
double get(unsigned int i, unsigned int j)
Accessor to element at row i and column j.
Definition: tmatrix.h:147

References _genoTable, and TMatrix::get().

◆ getGenoFitnessDiplo() [2/2]

double TProtoBDMI::getGenoFitnessDiplo ( unsigned int  row,
unsigned int  posA,
unsigned int  posB 
)
inline
90 {
91 return _genoTable->get(row, _diploGenotTableCoding[posA][posB] );
92 }
static unsigned int _diploGenotTableCoding[3][3]
Definition: ttbdmi.h:61

References _diploGenotTableCoding, _genoTable, and TMatrix::get().

Referenced by TT_BDMI::get_allele_value(), and TT_BDMI::viability_diplo().

+ Here is the caller graph for this function:

◆ getGenoFitnessHaplo()

double TProtoBDMI::getGenoFitnessHaplo ( unsigned int  row,
unsigned int  pos 
)
inline
84 {
85 assert(pos < 4);
86 return _genoTable->get(row, pos);
87 }

References _genoTable, and TMatrix::get().

Referenced by TT_BDMI::get_allele_value(), and TT_BDMI::viability_haplo().

+ Here is the caller graph for this function:

◆ hatch()

TTrait * TProtoBDMI::hatch ( )
virtual

Implements TraitPrototype.

181{
182 TT_BDMI* chick = new TT_BDMI();
183
184 chick->set_nb_locus(_nb_locus);
185 chick->set_mut_rate(_mut_rate);
191 chick->set_proto (this);
192 return chick;
193}
double _genomic_mut_rate
Definition: ttbdmi.h:57
Definition: ttbdmi.h:134
void set_inherit_func_ptr(void(TT_BDMI::*theFunc)(TTrait *, TTrait *))
Definition: ttbdmi.h:181
void set_nb_locus(int val)
Definition: ttbdmi.h:176
void set_isHaploid(bool val)
Definition: ttbdmi.h:180
void set_mut_rate(double val)
Definition: ttbdmi.h:177
void set_viability_func_ptr(double(TT_BDMI::*theFunc)(void))
Definition: ttbdmi.h:185
void set_proto(TProtoBDMI *proto)
Definition: ttbdmi.h:188
void set_mutation_func_ptr(void(TT_BDMI::*theFunc)(void))
Definition: ttbdmi.h:183
void set_geno_rate(double val)
Definition: ttbdmi.h:178

References _genomic_mut_rate, _inherit_func_ptr, _isHaploid, _mut_rate, _mutation_func_ptr, _nb_locus, _viability_func_ptr, TT_BDMI::set_geno_rate(), TT_BDMI::set_inherit_func_ptr(), TT_BDMI::set_isHaploid(), TT_BDMI::set_mut_rate(), TT_BDMI::set_mutation_func_ptr(), TT_BDMI::set_nb_locus(), TT_BDMI::set_proto(), and TT_BDMI::set_viability_func_ptr().

◆ inherit()

void TProtoBDMI::inherit ( sex_t  SEX,
bitstring seq,
bitstring **  parent 
)
inline
233{
234
235 register unsigned int nbRec, prevLoc = 0, chrm_bloc;
236 register bool flipper;
237
238 vector< unsigned int >& recTable = _map.getRecLoci(SEX, _mapIndex);
239 vector< bool > & firstRecPos = _map.getFirstRecPosition(SEX);
240
241 nbRec = recTable.size();
242
243 for(unsigned int c = 0, stride = 0, rec = 0; c < _numChromosome; ++c) {
244
245 flipper = firstRecPos[c];
246
247 chrm_bloc = stride + _numLociPerChrmsm[c]; //number of loci considered so far
248
249 prevLoc = stride; //stride is the first locus of a chromosome
250
251 //do recombination chromosome-wise
252 for(; recTable[rec] < chrm_bloc && rec < nbRec; rec++) {
253
254 seq->copy( *parent[flipper], prevLoc, recTable[rec]);
255
256 prevLoc = recTable[rec];
257
258 flipper = !flipper;
259 }
260
261 //copy what's left between the last x-over point and the end of the chrmsme
262 seq->copy( *parent[flipper], prevLoc, chrm_bloc);
263
264 stride += _numLociPerChrmsm[c];
265
266 }
267
268}
vector< unsigned int > & getRecLoci(sex_t SEX, unsigned int trait)
Returns a vector of the loci where crossing-overs take place.
Definition: ttrait_with_map.h:157
vector< bool > & getFirstRecPosition(sex_t SEX)
Returns the vector of the first chromosome position for recombination, used for all traits.
Definition: ttrait_with_map.h:163
static GeneticMap _map
Definition: ttrait_with_map.h:201
unsigned int _numChromosome
Definition: ttrait_with_map.h:189
unsigned int * _numLociPerChrmsm
Definition: ttrait_with_map.h:192
unsigned int _mapIndex
Definition: ttrait_with_map.h:185
void copy(const bitstring &b)
Unchecked copy, assumes we have sames sizes.
Definition: bitstring.h:260

References TTProtoWithMap::_map, TTProtoWithMap::_mapIndex, TTProtoWithMap::_numChromosome, TTProtoWithMap::_numLociPerChrmsm, bitstring::copy(), GeneticMap::getFirstRecPosition(), and GeneticMap::getRecLoci().

Referenced by TT_BDMI::inherit_diplo(), and TT_BDMI::inherit_haplo().

+ Here is the caller graph for this function:

◆ init()

virtual void TProtoBDMI::init ( )
inlinevirtual
109{setParameters();}
virtual bool setParameters()
Definition: ttbdmi.cc:88

References setParameters().

◆ isHaploid()

bool TProtoBDMI::isHaploid ( )
inline
79{return _isHaploid;}

References _isHaploid.

Referenced by TTBDMI_FH::FHwrite(), TTBDMI_SH::setAdultStats(), TTBDMI_SH::setOffsprgStats(), and TTBDMI_SH::setStats().

+ Here is the caller graph for this function:

◆ isInitSet()

bool TProtoBDMI::isInitSet ( )
inline
82{return _isInitSet;}

References _isInitSet.

Referenced by TT_BDMI::init_sequence().

+ Here is the caller graph for this function:

◆ loadFileServices()

void TProtoBDMI::loadFileServices ( FileServices loader)
virtual

Implements SimComponent.

138{
139 //writer
140 if(get_parameter("dmi_save_genotype")->isSet()) {
141
142 if(_writer == NULL) _writer = new TTBDMI_FH(this);
143
144 Param* param = get_parameter("dmi_logtime");
145
146 if(param->isMatrix()) {
147
148 TMatrix temp;
149 param->getMatrix(&temp);
150 _writer->set_multi(true, true, 1, &temp, get_parameter("dmi_output_dir")->getArg());
151
152 } else {
153 // rpl_per, gen_per, rpl_occ, gen_occ, rank, path, self-ref
154 _writer->set(true, true, 1, (param->isSet() ? (int)param->getValue() : 0),
155 0, get_parameter("dmi_output_dir")->getArg(),this);
156 }
157
158 loader->attach(_writer);
159
160 } else if(_writer != NULL) {
161 delete _writer;
162 _writer = NULL;
163 }
164}
virtual void set_multi(bool rpl_per, bool gen_per, int rpl_occ, TMatrix *Occ, string path)
Definition: filehandler.h:197
virtual void attach(Handler *FH)
Attaches the FileHandler to the current list (_writers) of the FileServices.
Definition: fileservices.cc:60
This structure stores one parameter, its definition and its string argument.
Definition: param.h:54
double getValue()
Returns the argument value according to its type.
Definition: param.cc:347
bool isMatrix()
Checks if the argument is of matrix type.
Definition: param.h:172
void getMatrix(TMatrix *mat)
Sets the matrix from the argument string if the parameter is set and of matrix type.
Definition: param.cc:357
bool isSet()
Definition: param.h:140
virtual Param * get_parameter(std::string name)
Param getter.
Definition: simcomponent.h:139
FileHandler for the DBMI trait.
Definition: ttbdmi.h:243
virtual void set(bool rpl_per, bool gen_per, int rpl_occ, int gen_occ, int rank, string path, TP *trait_proto)
Definition: filehandler.h:236

References _writer, FileServices::attach(), SimComponent::get_parameter(), Param::getMatrix(), Param::getValue(), Param::isMatrix(), Param::isSet(), TraitFileHandler< TP >::set(), and FileHandler::set_multi().

◆ loadStatServices()

void TProtoBDMI::loadStatServices ( StatServices loader)
virtual

Implements SimComponent.

169{
170 if(_stater != NULL)
171 delete _stater;
172
173 _stater = new TTBDMI_SH(this);
174
175 loader->attach(_stater);
176}
virtual void attach(Handler *H)
attach the StatHandler to the current list (_statHandlers) of the StatServices
Definition: statservices.cc:177
StatHandler for the DBMI trait.
Definition: ttbdmi.h:266

References _stater, and StatServices::attach().

◆ resetParameterFromSource()

virtual bool TProtoBDMI::resetParameterFromSource ( std::string  param,
SimComponent cmpt 
)
inlinevirtual

Implements SimComponent.

125{return false;}

◆ retrieve_data()

bool TProtoBDMI::retrieve_data ( BinaryStorageBuffer reader)
virtual

Implements StorableComponent.

271{
272 int dummy_int;
273 bool dummy_bool;
274
275 reader->read(&dummy_int, sizeof(int));
276
277 if(dummy_int != _nb_locus) {
278 warning("DMI mutation trait::locus number in binary source file differs from parameter value!\n\
279 >>>> adjusting locus number to match source population: %i set to %i\n", _nb_locus, dummy_int);
280 _nb_locus = dummy_int;
281 }
282 reader->read(&_isHaploid, sizeof(bool));
283
284 if(dummy_bool != _isHaploid){
285 warning("DMI mutation trait::haploidy in binary source file differs from parameter value!\n\
286 >>>> adjusting haploidy to match source population: %i set to %i\n", _isHaploid, dummy_bool);
287 _isHaploid = dummy_bool;
288 }
289
290 return true;
291}
void read(void *out, unsigned int nb_bytes)
Definition: binarystoragebuffer.h:162
void warning(const char *str,...)
Definition: output.cc:58

References _isHaploid, _nb_locus, BinaryStorageBuffer::read(), and warning().

◆ set_init_freq()

void TProtoBDMI::set_init_freq ( double *  val,
unsigned int  size 
)
198{
199 assert(size == _nb_locus);
200
201 if(_init_freq) delete [] _init_freq;
202
203 _init_freq = new double [size];
204
205 memcpy(_init_freq, val, size*sizeof(double));
206
207 _isInitSet = true;
208}

References _init_freq, _isInitSet, and _nb_locus.

Referenced by LCE_Init_BDMI::execute().

+ Here is the caller graph for this function:

◆ setGenoFitnessValue()

void TProtoBDMI::setGenoFitnessValue ( unsigned int  row,
unsigned int  geno,
double  value 
)
inline
101 { _genoTable->set(row, geno, value); }
void set(unsigned int i, unsigned int j, double val)
Sets element at row i and column j to value val.
Definition: tmatrix.h:102

References _genoTable, and TMatrix::set().

Referenced by TT_BDMI::set_allele_value().

+ Here is the caller graph for this function:

◆ setParameters()

bool TProtoBDMI::setParameters ( )
virtual

Implements SimComponent.

89{
90 _nb_locus = (unsigned int)get_parameter_value("dmi_loci");
91 _mut_rate = get_parameter_value("dmi_mutation_rate");
92
93 if(get_parameter("dmi_is_haploid")->isSet())
94 _isHaploid = (bool)get_parameter_value("dmi_is_haploid");
95 else
96 _isHaploid = 0; //diploid by default
97
99
100 if(_isHaploid){
104 } else {
108 }
109
110 //setting the incompatibility table:
111 if(_genoTable) delete _genoTable;
112
113 _genoTable = new TMatrix ();
114
115 get_parameter("dmi_genot_table")->getMatrix(_genoTable);
116
117 //checks on size of genoTable
118 if(_isHaploid && _genoTable->getNbCols() != 4)
119 return error("The genotype fitness table for DMI loci must have 4 columns in the haploid case.");
120
121 if(!_isHaploid && _genoTable->getNbCols() != 9)
122 return error("The genotype fitness table for DMI loci must have 9 columns in the diploid case.");
123
124
125 _isInitSet = 0;
126
127#ifdef _DEBUG_
128 message("::TProtoBDMI::\nFitness table:\n");
130#endif
131
133}
virtual double get_parameter_value(std::string name)
Param value getter.
Definition: simcomponent.h:143
unsigned int getNbCols()
Gives the number of columns.
Definition: tmatrix.h:169
void showGenoTable(unsigned int nrows)
Definition: ttbdmi.cc:212
bool setGeneticMapParameters(string prefix)
Definition: ttrait_with_map.cc:125
void mutate_diplo()
Definition: ttbdmi.cc:469
void inherit_diplo(TTrait *mother, TTrait *father)
Definition: ttbdmi.cc:430
double viability_diplo()
Definition: ttbdmi.cc:500
double viability_haplo()
Definition: ttbdmi.cc:485
void inherit_haplo(TTrait *mother, TTrait *father)
Definition: ttbdmi.cc:441
void mutate_haplo()
Definition: ttbdmi.cc:453
int error(const char *str,...)
Definition: output.cc:77
void message(const char *message,...)
Definition: output.cc:40

References _genomic_mut_rate, _genoTable, _inherit_func_ptr, _isHaploid, _isInitSet, _mut_rate, _mutation_func_ptr, _nb_locus, _viability_func_ptr, error(), SimComponent::get_parameter(), SimComponent::get_parameter_value(), Param::getMatrix(), TMatrix::getNbCols(), TT_BDMI::inherit_diplo(), TT_BDMI::inherit_haplo(), message(), TT_BDMI::mutate_diplo(), TT_BDMI::mutate_haplo(), TTProtoWithMap::setGeneticMapParameters(), showGenoTable(), TT_BDMI::viability_diplo(), and TT_BDMI::viability_haplo().

Referenced by init().

+ Here is the caller graph for this function:

◆ showGenoTable()

void TProtoBDMI::showGenoTable ( unsigned int  nrows)
213{
214 unsigned int len = (_isHaploid ? 4 : 9);
215
216 if(_isHaploid)
217 cout << "AB\taB\tAb\tab\n";
218 else
219 cout << "AABB\tAaBB\taaBB\t AABb\tAaBb\taaBb\t AAbb\tAabb\taabb\n";
220
221 for (unsigned int i = 0; i < nrows; ++i) {
222 cout << i+1 << ": ";
223 for (unsigned int j = 0; j < len ; ++j) {
224 cout << _genoTable->get(i, j) << "\t";
225 }
226 cout << endl;
227 }
228}

References _genoTable, _isHaploid, and TMatrix::get().

Referenced by setParameters(), and TT_BDMI::show_up().

+ Here is the caller graph for this function:

◆ store_data()

virtual void TProtoBDMI::store_data ( BinaryStorageBuffer saver)
inlinevirtual

Implements StorableComponent.

116 {
117 saver->store(&_nb_locus, sizeof(int));
118 saver->store(&_isHaploid, sizeof(bool));
119 }
void store(void *stream, unsigned int nb_bytes)
Definition: binarystoragebuffer.cc:16

References _isHaploid, _nb_locus, and BinaryStorageBuffer::store().

Member Data Documentation

◆ _diploGenotTableCoding

unsigned int TProtoBDMI::_diploGenotTableCoding = {{0,1,2},{3,4,5},{6,7,8}}
staticprivate

Referenced by getGenoFitnessDiplo().

◆ _genomic_mut_rate

double TProtoBDMI::_genomic_mut_rate
private

Referenced by hatch(), and setParameters().

◆ _genoTable

◆ _inherit_func_ptr

void(TT_BDMI::* TProtoBDMI::_inherit_func_ptr) (TTrait *, TTrait *)
private

Referenced by hatch(), and setParameters().

◆ _init_freq

double* TProtoBDMI::_init_freq
private

◆ _isHaploid

bool TProtoBDMI::_isHaploid
private

◆ _isInitSet

bool TProtoBDMI::_isInitSet
private

◆ _mut_rate

double TProtoBDMI::_mut_rate
private

Referenced by get_mut_rate(), hatch(), and setParameters().

◆ _mutation_func_ptr

void(TT_BDMI::* TProtoBDMI::_mutation_func_ptr) (void)
private

Referenced by hatch(), and setParameters().

◆ _nb_locus

unsigned int TProtoBDMI::_nb_locus
private

◆ _recomb_rate

double TProtoBDMI::_recomb_rate
private

◆ _stater

TTBDMI_SH* TProtoBDMI::_stater
private

Referenced by loadStatServices(), and ~TProtoBDMI().

◆ _type

trait_t TProtoBDMI::_type
private

Referenced by get_type().

◆ _viability_func_ptr

double(TT_BDMI::* TProtoBDMI::_viability_func_ptr) (void)
private

Referenced by hatch(), and setParameters().

◆ _writer

TTBDMI_FH* TProtoBDMI::_writer
private

Referenced by loadFileServices(), and ~TProtoBDMI().


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

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