Nemo  2.3.46
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)
 
- 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 ()
 
virtual void reset ()
 
- Public Member Functions inherited from TraitPrototype
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 ~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...
 

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::TProtoBDMI ( )

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

Referenced by clone().

39  :
40 _type("dmi"), _isHaploid(1), _nb_locus(0), _mut_rate(0), _recomb_rate(0), _init_freq(0),
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 }
TMatrix * _genoTable
Definition: ttbdmi.h:67
double _mut_rate
Definition: ttbdmi.h:56
double _recomb_rate
Definition: ttbdmi.h:58
virtual void set_paramset(ParamSet *paramset)
Sets the ParamSet member.
Definition: simcomponent.h:86
Definition: types.h:78
virtual void add_parameter(Param *param)
Interface to add a parameter to the set.
Definition: simcomponent.h:112
Definition: types.h:78
void addGeneticMapParameters(string prefix)
Definition: ttrait_with_map.cc:77
double * _init_freq
Definition: ttbdmi.h:59
void(TT_BDMI::* _inherit_func_ptr)(TTrait *, TTrait *)
Definition: ttbdmi.h:63
bool _isHaploid
Definition: ttbdmi.h:54
trait_t _type
Definition: ttbdmi.h:52
Definition: types.h:78
TTBDMI_FH * _writer
Definition: ttbdmi.h:69
unsigned int _nb_locus
Definition: ttbdmi.h:55
Definition: types.h:78
double(TT_BDMI::* _viability_func_ptr)(void)
Definition: ttbdmi.h:65
bool _isInitSet
Definition: ttbdmi.h:60
void(TT_BDMI::* _mutation_func_ptr)(void)
Definition: ttbdmi.h:64
TTBDMI_SH * _stater
Definition: ttbdmi.h:68
Definition: types.h:78
TProtoBDMI::TProtoBDMI ( const TProtoBDMI TP)

References _genoTable, and SimComponent::_paramSet.

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 }
TMatrix * _genoTable
Definition: ttbdmi.h:67
double _mut_rate
Definition: ttbdmi.h:56
double _recomb_rate
Definition: ttbdmi.h:58
double * _init_freq
Definition: ttbdmi.h:59
void(TT_BDMI::* _inherit_func_ptr)(TTrait *, TTrait *)
Definition: ttbdmi.h:63
A class to handle matrix in params, coerces matrix into a vector of same total size.
Definition: tmatrix.h:49
bool _isHaploid
Definition: ttbdmi.h:54
ParamSet * _paramSet
The parameters container.
Definition: simcomponent.h:48
trait_t _type
Definition: ttbdmi.h:52
TTBDMI_FH * _writer
Definition: ttbdmi.h:69
unsigned int _nb_locus
Definition: ttbdmi.h:55
double(TT_BDMI::* _viability_func_ptr)(void)
Definition: ttbdmi.h:65
Parameters container, implemented in each SimComponent.
Definition: param.h:203
bool _isInitSet
Definition: ttbdmi.h:60
void(TT_BDMI::* _mutation_func_ptr)(void)
Definition: ttbdmi.h:64
TTBDMI_SH * _stater
Definition: ttbdmi.h:68
TProtoBDMI::~TProtoBDMI ( )
virtual

References _genoTable, _init_freq, _stater, and _writer.

80 {
81  if(_genoTable) delete _genoTable; if(_stater) delete _stater; if(_writer) delete _writer;
82  if(_init_freq) delete [] _init_freq;
83 }
TMatrix * _genoTable
Definition: ttbdmi.h:67
double * _init_freq
Definition: ttbdmi.h:59
TTBDMI_FH * _writer
Definition: ttbdmi.h:69
TTBDMI_SH * _stater
Definition: ttbdmi.h:68

Member Function Documentation

virtual TraitPrototype* TProtoBDMI::clone ( )
inlinevirtual

Implements TraitPrototype.

References TProtoBDMI().

109 {return new TProtoBDMI(*this);}
TProtoBDMI()
Definition: ttbdmi.cc:39
double TProtoBDMI::get_init_freq ( unsigned int  i)
inline

Referenced by TT_BDMI::init_sequence().

81 {return _init_freq[i];}
double * _init_freq
Definition: ttbdmi.h:59
double TProtoBDMI::get_mut_rate ( )
inline

References _mut_rate.

78 {return _mut_rate;}
double _mut_rate
Definition: ttbdmi.h:56
virtual trait_t TProtoBDMI::get_type ( ) const
inlinevirtual

Implements TraitPrototype.

References _type.

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

110 {return _type;}
trait_t _type
Definition: ttbdmi.h:52
double TProtoBDMI::getGenoFitnessDiplo ( unsigned int  row,
unsigned int  posA,
unsigned int  posB 
)
inline

References TMatrix::get().

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

89  {
90  return _genoTable->get(row, _diploGenotTableCoding[posA][posB] );
91  }
TMatrix * _genoTable
Definition: ttbdmi.h:67
double get(unsigned int i, unsigned int j)
Accessor to element at row i and column j.
Definition: tmatrix.h:120
static unsigned int _diploGenotTableCoding[3][3]
Definition: ttbdmi.h:61
double TProtoBDMI::getGenoFitnessDiplo ( unsigned int  row,
unsigned int  pos 
)
inline

References TMatrix::get().

93  {
94  assert(pos < 9);
95  return _genoTable->get(row, pos);
96  }
TMatrix * _genoTable
Definition: ttbdmi.h:67
double get(unsigned int i, unsigned int j)
Accessor to element at row i and column j.
Definition: tmatrix.h:120
double TProtoBDMI::getGenoFitnessHaplo ( unsigned int  row,
unsigned int  pos 
)
inline

References TMatrix::get().

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

84  {
85  assert(pos < 4);
86  return _genoTable->get(row, pos);
87  }
TMatrix * _genoTable
Definition: ttbdmi.h:67
double get(unsigned int i, unsigned int j)
Accessor to element at row i and column j.
Definition: tmatrix.h:120
TTrait * TProtoBDMI::hatch ( )
virtual

Implements TraitPrototype.

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().

181 {
182  TT_BDMI* chick = new TT_BDMI();
183 
184  chick->set_nb_locus(_nb_locus);
185  chick->set_mut_rate(_mut_rate);
187  chick->set_isHaploid(_isHaploid);
191  chick->set_proto (this);
192  return chick;
193 }
void set_mutation_func_ptr(void(TT_BDMI::*theFunc)(void))
Definition: ttbdmi.h:176
void set_nb_locus(int val)
Definition: ttbdmi.h:169
Definition: ttbdmi.h:127
void set_isHaploid(bool val)
Definition: ttbdmi.h:173
void set_proto(TProtoBDMI *proto)
Definition: ttbdmi.h:181
double _mut_rate
Definition: ttbdmi.h:56
double _genomic_mut_rate
Definition: ttbdmi.h:57
void set_viability_func_ptr(double(TT_BDMI::*theFunc)(void))
Definition: ttbdmi.h:178
void set_mut_rate(double val)
Definition: ttbdmi.h:170
void(TT_BDMI::* _inherit_func_ptr)(TTrait *, TTrait *)
Definition: ttbdmi.h:63
void set_inherit_func_ptr(void(TT_BDMI::*theFunc)(TTrait *, TTrait *))
Definition: ttbdmi.h:174
bool _isHaploid
Definition: ttbdmi.h:54
void set_geno_rate(double val)
Definition: ttbdmi.h:171
unsigned int _nb_locus
Definition: ttbdmi.h:55
double(TT_BDMI::* _viability_func_ptr)(void)
Definition: ttbdmi.h:65
void(TT_BDMI::* _mutation_func_ptr)(void)
Definition: ttbdmi.h:64
void TProtoBDMI::inherit ( sex_t  SEX,
bitstring seq,
bitstring **  parent 
)
inline

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().

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 }
static GeneticMap _map
Definition: ttrait_with_map.h:190
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:155
void copy(const bitstring &b)
Unchecked copy, assumes we have sames sizes.
Definition: bitstring.h:255
unsigned int * _numLociPerChrmsm
Definition: ttrait_with_map.h:181
unsigned int _numChromosome
Definition: ttrait_with_map.h:178
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:149
unsigned int _mapIndex
Definition: ttrait_with_map.h:174
virtual void TProtoBDMI::init ( )
inlinevirtual

References setParameters().

107 {setParameters();}
virtual bool setParameters()
Definition: ttbdmi.cc:88
bool TProtoBDMI::isHaploid ( )
inline

References _isHaploid.

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

79 {return _isHaploid;}
bool _isHaploid
Definition: ttbdmi.h:54
bool TProtoBDMI::isInitSet ( )
inline

References _isInitSet.

Referenced by TT_BDMI::init_sequence().

82 {return _isInitSet;}
bool _isInitSet
Definition: ttbdmi.h:60
void TProtoBDMI::loadFileServices ( FileServices loader)
virtual

Implements SimComponent.

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

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 }
FileHandler for the DBMI trait.
Definition: ttbdmi.h:236
virtual void attach(Handler *FH)
Attaches the FileHandler to the current list (_writers) of the FileServices.
Definition: fileservices.cc:57
double getValue()
Returns the argument value according to its type.
Definition: param.cc:319
void getMatrix(TMatrix *mat)
Sets the matrix from the argument string if the parameter is set and of matrix type.
Definition: param.cc:329
bool isMatrix()
Checks if the argument is of matrix type.
Definition: param.h:170
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
This structure stores one parameter, its definition and its string argument.
Definition: param.h:53
A class to handle matrix in params, coerces matrix into a vector of same total size.
Definition: tmatrix.h:49
virtual void set_multi(bool rpl_per, bool gen_per, int rpl_occ, TMatrix *Occ, string path)
Definition: filehandler.h:197
string getArg()
Definition: param.h:136
virtual Param * get_parameter(std::string name)
Param getter.
Definition: simcomponent.h:139
TTBDMI_FH * _writer
Definition: ttbdmi.h:69
bool isSet()
Definition: param.h:138
void TProtoBDMI::loadStatServices ( StatServices loader)
virtual

Implements SimComponent.

References _stater, and StatServices::attach().

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
TTBDMI_SH * _stater
Definition: ttbdmi.h:68
StatHandler for the DBMI trait.
Definition: ttbdmi.h:259
virtual bool TProtoBDMI::retrieve_data ( BinaryStorageBuffer reader)
inlinevirtual

Implements StorableComponent.

114 {return true;}
void TProtoBDMI::set_init_freq ( double *  val,
unsigned int  size 
)

References _init_freq, _isInitSet, and _nb_locus.

Referenced by LCE_Init_BDMI::execute().

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 }
double * _init_freq
Definition: ttbdmi.h:59
unsigned int _nb_locus
Definition: ttbdmi.h:55
bool _isInitSet
Definition: ttbdmi.h:60
void TProtoBDMI::setGenoFitnessValue ( unsigned int  row,
unsigned int  geno,
double  value 
)
inline

References TMatrix::set().

Referenced by TT_BDMI::set_allele_value().

99  { _genoTable->set(row, geno, value); }
TMatrix * _genoTable
Definition: ttbdmi.h:67
void set(unsigned int i, unsigned int j, double val)
Sets element at row i and column j to value val.
Definition: tmatrix.h:85
bool TProtoBDMI::setParameters ( )
virtual

Implements SimComponent.

References _genomic_mut_rate, _genoTable, _inherit_func_ptr, _isHaploid, _isInitSet, _mut_rate, _mutation_func_ptr, _nb_locus, _viability_func_ptr, fatal(), 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().

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  //@TODO add checks on size of genoTable!!
118  if(_isHaploid && _genoTable->getNbCols() != 4)
119  fatal("The genotype fitness table for DMI loci must have 4 columns in the haploid case.");
120 
121  if(!_isHaploid && _genoTable->getNbCols() != 9)
122  fatal("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 }
void message(const char *message,...)
Definition: output.cc:40
TMatrix * _genoTable
Definition: ttbdmi.h:67
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:142
void getMatrix(TMatrix *mat)
Sets the matrix from the argument string if the parameter is set and of matrix type.
Definition: param.cc:329
double _mut_rate
Definition: ttbdmi.h:56
double _genomic_mut_rate
Definition: ttbdmi.h:57
void fatal(const char *str,...)
Definition: output.cc:90
void mutate_haplo()
Definition: ttbdmi.cc:429
double viability_diplo()
Definition: ttbdmi.cc:475
void inherit_diplo(TTrait *mother, TTrait *father)
Definition: ttbdmi.cc:406
void(TT_BDMI::* _inherit_func_ptr)(TTrait *, TTrait *)
Definition: ttbdmi.h:63
void inherit_haplo(TTrait *mother, TTrait *father)
Definition: ttbdmi.cc:417
A class to handle matrix in params, coerces matrix into a vector of same total size.
Definition: tmatrix.h:49
bool _isHaploid
Definition: ttbdmi.h:54
bool setGeneticMapParameters(string prefix)
Definition: ttrait_with_map.cc:88
double viability_haplo()
Definition: ttbdmi.cc:461
virtual Param * get_parameter(std::string name)
Param getter.
Definition: simcomponent.h:139
unsigned int _nb_locus
Definition: ttbdmi.h:55
void mutate_diplo()
Definition: ttbdmi.cc:445
void showGenoTable(unsigned int nrows)
Definition: ttbdmi.cc:212
double(TT_BDMI::* _viability_func_ptr)(void)
Definition: ttbdmi.h:65
bool _isInitSet
Definition: ttbdmi.h:60
void(TT_BDMI::* _mutation_func_ptr)(void)
Definition: ttbdmi.h:64
void TProtoBDMI::showGenoTable ( unsigned int  nrows)

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

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

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 }
TMatrix * _genoTable
Definition: ttbdmi.h:67
double get(unsigned int i, unsigned int j)
Accessor to element at row i and column j.
Definition: tmatrix.h:120
bool _isHaploid
Definition: ttbdmi.h:54
virtual void TProtoBDMI::store_data ( BinaryStorageBuffer saver)
inlinevirtual

Implements StorableComponent.

113 {}

Member Data Documentation

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

Referenced by hatch(), and setParameters().

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

Referenced by hatch(), and setParameters().

double* TProtoBDMI::_init_freq
private

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

bool TProtoBDMI::_isHaploid
private
bool TProtoBDMI::_isInitSet
private
double TProtoBDMI::_mut_rate
private

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

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

Referenced by hatch(), and setParameters().

unsigned int TProtoBDMI::_nb_locus
private
double TProtoBDMI::_recomb_rate
private
TTBDMI_SH* TProtoBDMI::_stater
private

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

trait_t TProtoBDMI::_type
private

Referenced by get_type().

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

Referenced by hatch(), and setParameters().

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.0 by  doxygen 1.8.8 --
Catalogued on GSR