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

Implementation of the basic breeding and mating procedures, does not link to any trait. More...

#include <LCEquanti.h>

+ Inheritance diagram for LCE_Breed_Quanti:
+ Collaboration diagram for LCE_Breed_Quanti:

Public Member Functions

 LCE_Breed_Quanti ()
 
virtual ~LCE_Breed_Quanti ()
 
void setVefromVa (Patch *patch, age_idx AGE)
 
void setIndPhenotype (Patch *patch, sex_t SEX, age_idx AGE)
 
void NonWrightFisherPopulation ()
 
void WrightFisherPopulation ()
 
Implementations
virtual bool setParameters ()
 
virtual void execute ()
 
virtual LifeCycleEventclone ()
 
virtual void loadFileServices (FileServices *loader)
 
virtual void loadStatServices (StatServices *loader)
 
virtual bool resetParameterFromSource (std::string param, SimComponent *cmpt)
 
virtual age_t removeAgeClass ()
 
virtual age_t addAgeClass ()
 
virtual age_t requiredAgeClass ()
 
- Public Member Functions inherited from LCE_Breed_base
 LCE_Breed_base ()
 
virtual ~LCE_Breed_base ()
 
virtual IndividualgetFatherPtr (Patch *thePatch, Individual *mother, unsigned int motherIndex)
 Calls the mating function according to the model chosen using the function pointer, used to get the father from the mother in a patch. More...
 
void NonWrightFisherPopulation ()
 
void WrightFisherPopulation ()
 
void doAgingInWFpop ()
 
Individualbreed (Individual *mother, Individual *father, unsigned int LocalPatch)
 Makes a new individual with the right parents. More...
 
Individualbreed_cloning (Individual *mother, Individual *father, unsigned int LocalPatch)
 Makes a new individual by doing a deep copy of the mother (copies the mother's genes into the offspring). More...
 
IndividualmakeOffspring (Individual *ind)
 Last step of the breeding process, does inheritance and mutation of the parents' genes. More...
 
IndividualmakeOffspring (Individual *newind, Individual *mother, Individual *father, unsigned int natalPatch)
 Overloads previous function when a new offspring is created "in-place", that is from existing pointer in a patch. More...
 
Individualdo_breed (Individual *mother, Individual *father, unsigned int LocalPatch)
 Calls the breeding function unsing its pointer. More...
 
bool checkMatingCondition (Patch *thePatch)
 Checks if any mating will take place in the patch passed as argument. More...
 
bool checkNoSelfing (Patch *thePatch)
 Checks whether mating will take place in the current patch when mating is not selfing or cloning. More...
 
bool checkPolygyny (Patch *thePatch)
 Checks whether mating will take place in the current patch when mating is polygynous. More...
 
bool checkSelfing (Patch *thePatch)
 Checks whether mating will take place in the current patch when mating is selfing. More...
 
bool checkCloning (Patch *thePatch)
 Checks whether mating will take place in the current patch when mating is cloning. More...
 
bool setMatingSystem ()
 
bool setFecundity ()
 
bool setSexRatio ()
 
double getMatingProportion ()
 
double getMeanFecundity (unsigned int patch)
 
int getMatingSystem ()
 
bool doInheritance ()
 
double getPoissonFecundity (double mean)
 
double getFixedFecundity (double mean)
 
double getGaussianFecundity (double mean)
 
double getLogNormalFecundity (double mean)
 
double getFecundity (unsigned int patch)
 
double getFecundity (double mean)
 
sex_t getOffsprgSex ()
 
sex_t getOffsprgSexRandom ()
 
sex_t getOffsprgSexFixed ()
 
sex_t getOffsprgSexSelfing ()
 
sex_t getOffsprgSexCloning ()
 
bool isWrightFisher ()
 
IndividualRandomMating (Patch *thePatch, Individual *mother, unsigned int motherIndex)
 Returns a pointer to a male drawn randomly from a patch. More...
 
IndividualfullPolyginy (Patch *thePatch, Individual *mother, unsigned int motherIndex)
 Returns a pointer to the alpha male of the patch. More...
 
IndividualfullPolyginy_manyMales (Patch *thePatch, Individual *mother, unsigned int motherIndex)
 Returns a pointer to one of the first _mating_males males of the patch. More...
 
IndividualpartialPolyginy (Patch *thePatch, Individual *mother, unsigned int motherIndex)
 Returns a pointer to a male from a patch chosen at random if _mating_proportion != 1, or the first male otherwise. More...
 
IndividualpartialPolyginy_manyMales (Patch *thePatch, Individual *mother, unsigned int motherIndex)
 Returns a pointer to a male from a patch chosen at random if _mating_proportion != 1, or one of the _mating_males first males otherwise. More...
 
IndividualfullMonoginy (Patch *thePatch, Individual *mother, unsigned int motherIndex)
 Returns a pointer to a male with same index as mother (if available) from the focal patch. More...
 
IndividualpartialMonoginy (Patch *thePatch, Individual *mother, unsigned int motherIndex)
 Returns a pointer to a male with same index as mother (if available) from the focal patch. More...
 
IndividualfullSelfing (Patch *thePatch, Individual *mother, unsigned int motherIndex)
 Returns the mother pointer. More...
 
IndividualpartialSelfing (Patch *thePatch, Individual *mother, unsigned int motherIndex)
 Returns the mother pointer or a random female if _mating_proportion != 1. More...
 
Individualrandom_hermaphrodite (Patch *thePatch, Individual *mother, unsigned int motherIndex)
 Returns a random female from the patch, will be the same mother with probability 1/N (Wright-Fisher model). More...
 
- Public Member Functions inherited from LifeCycleEvent
 LifeCycleEvent (const char *name, const char *trait_link)
 Cstor. More...
 
virtual ~LifeCycleEvent ()
 
virtual void init (Metapop *popPtr)
 Sets the pointer to the current Metapop and the trait link if applicable. More...
 
virtual bool attach_trait (string trait)
 
virtual void set_paramset (std::string name, bool required, SimComponent *owner)
 
virtual void set_event_name (std::string &name)
 Set the name of the event (name of the ParamSet) and add the corresponding parameter to the set. More...
 
virtual void set_event_name (const char *name)
 
virtual string & get_event_name ()
 Accessor to the LCE's name. More...
 
virtual int get_rank ()
 Accessor to the LCE rank in the life cycle. More...
 
virtual void set_pop_ptr (Metapop *popPtr)
 Accessors for the population pointer. More...
 
virtual Metapopget_pop_ptr ()
 
- 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_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

TProtoQuanti_QuantiProto
 
vector< double > _h2
 
vector< double >(TTQuantiSH::* _get_VA_func_ptr )(Patch *, const age_idx)
 
void(LCE_Breed_Quanti::* _myPopModelFuncPtr )(void)
 

Additional Inherited Members

- Protected Attributes inherited from LCE_Breed_base
TMatrix _mean_fecundity
 
Individual *(LCE_Breed_base::* MatingFuncPtr )(Patch *, Individual *, unsigned int)
 
Individual *(LCE_Breed_base::* DoBreedFuncPtr )(Individual *mother, Individual *father, unsigned int LocalPatch)
 
double(LCE_Breed_base::* FecundityFuncPtr )(double mean)
 
bool(LCE_Breed_base::* CheckMatingConditionFuncPtr )(Patch *thePatch)
 
sex_t(LCE_Breed_base::* GetOffsprgSex )()
 
void(LCE_Breed_base::* PopModelFuncPtr )(void)
 
- Protected Attributes inherited from LifeCycleEvent
std::string _event_name
 The param name to be read in the init file. More...
 
Metapop_popPtr
 The ptr to the current Metapop. More...
 
std::string _LCELinkedTraitType
 The name of the linked trait. More...
 
int _LCELinkedTraitIndex
 The index in the individual's trait table of the linked trait. More...
 
- Protected Attributes inherited from SimComponent
ParamSet_paramSet
 The parameters container. More...
 

Detailed Description

Implementation of the basic breeding and mating procedures, does not link to any trait.

Individuals mate according to the mating system chosen. The mated adults are not removed from the population. The offspring containers are filled with the new generation. Note that they are first emptied if still containing offspring individuals when starting the breeding process.

The population's age is set to ALL. The mating and realized fecundity counters of the reproducing males and females are updated.

See also
LCE_Breed_base

Constructor & Destructor Documentation

◆ LCE_Breed_Quanti()

LCE_Breed_Quanti::LCE_Breed_Quanti ( )
inline
142  : LifeCycleEvent("breed_quanti","quant"), _QuantiProto(0),
TProtoQuanti * _QuantiProto
Definition: LCEquanti.h:133
void(LCE_Breed_Quanti::* _myPopModelFuncPtr)(void)
Definition: LCEquanti.h:138
vector< double >(TTQuantiSH::* _get_VA_func_ptr)(Patch *, const age_idx)
Definition: LCEquanti.h:136
LifeCycleEvent(const char *name, const char *trait_link)
Cstor.
Definition: lifecycleevent.h:97

Referenced by clone().

+ Here is the caller graph for this function:

◆ ~LCE_Breed_Quanti()

virtual LCE_Breed_Quanti::~LCE_Breed_Quanti ( )
inlinevirtual
145 { }

Member Function Documentation

◆ addAgeClass()

virtual age_t LCE_Breed_Quanti::addAgeClass ( )
inlinevirtual

Implements LifeCycleEvent.

166 {return OFFSPRG;}
#define OFFSPRG
Offspring age class flag.
Definition: types.h:49

References OFFSPRG.

◆ clone()

virtual LifeCycleEvent* LCE_Breed_Quanti::clone ( )
inlinevirtual

Implements LifeCycleEvent.

160 {return new LCE_Breed_Quanti();}
LCE_Breed_Quanti()
Definition: LCEquanti.h:142

References LCE_Breed_Quanti().

◆ execute()

void LCE_Breed_Quanti::execute ( )
virtual

Implements LifeCycleEvent.

430 {
431 #ifdef _DEBUG_
432  message("LCE_Breed_Quanti::execute (Patch nb: %i offsprg nb: %i adlt nb: %i)\n"
434 #endif
435 
436  if(_popPtr->size(OFFSPRG) != 0) {
437  warning("offspring containers not empty at time of breeding, flushing.\n");
438  _popPtr->flush(OFFSx);
439  }
440 
441  //because mean fecundity can be patch-specific, we have to check whether the patch number changed
443 
444  // proceed with mating and breeding
445  (this->* _myPopModelFuncPtr)(); // calls either 'NonWrightFisherPopulation' or 'WrightFisherPopulation'
446 
447 }
bool setFecundity()
Definition: LCEbreed.cc:263
TMatrix _mean_fecundity
Definition: LCEbreed.h:67
Metapop * _popPtr
The ptr to the current Metapop.
Definition: lifecycleevent.h:80
unsigned int size()
Get the total number of individuals present in the population, all sex and age classes together.
Definition: metapop.h:311
unsigned int getPatchNbr()
Definition: metapop.h:275
void flush()
Removes all individual pointers and flush them into the recycling pool.
Definition: metapop.h:848
unsigned int ncols() const
Definition: tmatrix.h:215
void warning(const char *str,...)
Definition: output.cc:57
void message(const char *message,...)
Definition: output.cc:39
#define ADULTS
Adults age class flag (breeders).
Definition: types.h:53
@ OFFSx
Definition: types.h:41

References LCE_Breed_base::_mean_fecundity, _myPopModelFuncPtr, LifeCycleEvent::_popPtr, ADULTS, Metapop::flush(), Metapop::getPatchNbr(), message(), TMatrix::ncols(), OFFSPRG, OFFSx, LCE_Breed_base::setFecundity(), Metapop::size(), and warning().

◆ loadFileServices()

virtual void LCE_Breed_Quanti::loadFileServices ( FileServices loader)
inlinevirtual

Implements SimComponent.

162 {}

◆ loadStatServices()

virtual void LCE_Breed_Quanti::loadStatServices ( StatServices loader)
inlinevirtual

Implements SimComponent.

163 {}

◆ NonWrightFisherPopulation()

void LCE_Breed_Quanti::NonWrightFisherPopulation ( )
452 {
453  Patch* patch;
454  Individual* mother;
455  Individual* father;
456  Individual* NewOffsprg;
457  unsigned int nbBaby;
458 
459 #ifdef _DEBUG_
460  message("LCE_Breed_Quanti::execute::NonWrightFisherPopulation::mating system: %i; mean fecundity[0]: %f",
462 #endif
463 
464  _h2 = _QuantiProto->get_heritability(); //may have been reset during a run
465 
466  for(unsigned int i = 0; i < _popPtr->getPatchNbr(); i++) {
467 
468  patch = _popPtr->getPatch(i);
469 
470  if( !checkMatingCondition(patch) ) continue;
471 
472 
473  for(unsigned int size = patch->size(FEM, ADLTx), indexOfMother = 0;
474  indexOfMother < size;
475  indexOfMother++)
476  {
477  mother = patch->get(FEM, ADLTx, indexOfMother);
478 
479  nbBaby = (unsigned int)mother->setFecundity( getFecundity(i) ) ; //allows for patch-specific fec
480  //-----------------------------------------------------------------------
481  while(nbBaby != 0) {
482 
483  father = this->getFatherPtr(patch, mother, indexOfMother);
484 
485  NewOffsprg = makeOffspring( do_breed(mother, father, i) );
486 
487  patch->add(NewOffsprg->getSex(), OFFSx, NewOffsprg);
488 
489  nbBaby--;
490  }//_END__WHILE
491 
492  }// for female
493 
494  // compute Va in each patch to set Ve to match the h2 required
495  setVefromVa(patch,OFFSx);
496 
497  setIndPhenotype(patch, FEM, OFFSx);
498  setIndPhenotype(patch, MAL, OFFSx);
499 
500  } //for patch
501 
502 #ifdef _DEBUG_
503  message("done, new offsprg nb: %i \n",_popPtr->size( OFFSPRG ));
504 #endif
505 }
This class contains traits along with other individual information (sex, pedigree,...
Definition: individual.h:48
double setFecundity(double value)
Sets the fecundity to the value given and returns it.
Definition: individual.h:206
sex_t getSex()
Definition: individual.h:128
void setVefromVa(Patch *patch, age_idx AGE)
Definition: LCEquanti.cc:566
vector< double > _h2
Definition: LCEquanti.h:134
void setIndPhenotype(Patch *patch, sex_t SEX, age_idx AGE)
Definition: LCEquanti.cc:596
int getMatingSystem()
Definition: LCEbreed.h:101
virtual Individual * getFatherPtr(Patch *thePatch, Individual *mother, unsigned int motherIndex)
Calls the mating function according to the model chosen using the function pointer,...
Definition: LCEbreed.h:81
Individual * makeOffspring(Individual *ind)
Last step of the breeding process, does inheritance and mutation of the parents' genes.
Definition: LCEbreed.cc:350
Individual * do_breed(Individual *mother, Individual *father, unsigned int LocalPatch)
Calls the breeding function unsing its pointer.
Definition: LCEbreed.h:176
bool checkMatingCondition(Patch *thePatch)
Checks if any mating will take place in the patch passed as argument.
Definition: LCEbreed.h:185
double getFecundity(unsigned int patch)
Definition: LCEbreed.h:111
Patch * getPatch(unsigned int i)
Patch accessor, return the ith+1 patch in the metapop.
Definition: metapop.h:256
Second class in the metapopulation design structure, between the Metapop and Individual classes.
Definition: metapop.h:431
unsigned int size(age_t AGE)
Returns the size of the container of the appropriate age class(es) for both sexes.
Definition: metapop.h:497
Individual * get(sex_t SEX, age_idx AGE, unsigned int at)
Returns a pointer to the individual sitting at the index passed.
Definition: metapop.h:533
void add(sex_t SEX, age_idx AGE, Individual *ind)
Adds an individual to the appropriate container, increments its size, eventually resizing it.
Definition: metapop.h:550
double get(unsigned int i, unsigned int j) const
Accessor to element at row i and column j.
Definition: tmatrix.h:192
vector< double > get_heritability()
Definition: ttquanti.h:430
@ FEM
Definition: types.h:36
@ MAL
Definition: types.h:36
@ ADLTx
Definition: types.h:41

References _h2, LCE_Breed_base::_mean_fecundity, LifeCycleEvent::_popPtr, _QuantiProto, Patch::add(), ADLTx, LCE_Breed_base::checkMatingCondition(), LCE_Breed_base::do_breed(), FEM, Patch::get(), TMatrix::get(), TProtoQuanti::get_heritability(), LCE_Breed_base::getFatherPtr(), LCE_Breed_base::getFecundity(), LCE_Breed_base::getMatingSystem(), Metapop::getPatch(), Metapop::getPatchNbr(), Individual::getSex(), LCE_Breed_base::makeOffspring(), MAL, message(), OFFSPRG, OFFSx, Individual::setFecundity(), setIndPhenotype(), setVefromVa(), Metapop::size(), and Patch::size().

Referenced by setParameters().

+ Here is the caller graph for this function:

◆ removeAgeClass()

virtual age_t LCE_Breed_Quanti::removeAgeClass ( )
inlinevirtual

Implements LifeCycleEvent.

165 {return 0;}

◆ requiredAgeClass()

virtual age_t LCE_Breed_Quanti::requiredAgeClass ( )
inlinevirtual

Implements LifeCycleEvent.

167 {return ADULTS;}

References ADULTS.

◆ resetParameterFromSource()

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

Implements SimComponent.

164 {return false;}

◆ setIndPhenotype()

void LCE_Breed_Quanti::setIndPhenotype ( Patch patch,
sex_t  SEX,
age_idx  AGE 
)
597 {
598  for(unsigned int i = 0; i < patch->size(SEX, AGE); ++i)
599  {
600  patch->get(SEX, AGE, i)->setTraitValue(_LCELinkedTraitIndex);
601  }
602 }
void setTraitValue(IDX T)
Calls the value setting procedure of a particular trait.
Definition: individual.h:260
int _LCELinkedTraitIndex
The index in the individual's trait table of the linked trait.
Definition: lifecycleevent.h:88

References LifeCycleEvent::_LCELinkedTraitIndex, Patch::get(), Individual::setTraitValue(), and Patch::size().

Referenced by NonWrightFisherPopulation(), and WrightFisherPopulation().

+ Here is the caller graph for this function:

◆ setParameters()

bool LCE_Breed_Quanti::setParameters ( )
virtual

Reimplemented from LCE_Breed_base.

406 {
407 
408  _QuantiProto = dynamic_cast<TProtoQuanti*> ( _popPtr->getTraitPrototype("quant") );
409 
410  //check for allele model
413  else
415 
416  if(!LCE_Breed_base::setParameters( )) return false;
417 
418  //by default, the population is not kept at constant size, ie not Wright-Fisher
420 
421  if(get_parameter("mating_isWrightFisher")->isSet())
423 
424  return true;
425 }
TraitPrototype * getTraitPrototype(trait_t type)
Accessor to a TraitPrototype.
Definition: indfactory.cc:139
void WrightFisherPopulation()
Definition: LCEquanti.cc:509
void NonWrightFisherPopulation()
Definition: LCEquanti.cc:451
virtual bool setParameters()
Definition: LCEbreed.cc:76
bool isSet()
Definition: param.h:139
virtual Param * get_parameter(std::string name)
Param getter.
Definition: simcomponent.h:138
TProtoQuanti.
Definition: ttquanti.h:414
unsigned int get_dominance_model()
Definition: ttquanti.h:477
vector< double > getVaNoDominance(Patch *curPop, const age_idx AGE)
Definition: ttquanti.cc:5389
vector< double > getVaWithDominance(Patch *curPop, const age_idx AGE)
computation of the additive genetic variance from the average excess of each allele exact under rando...
Definition: ttquanti.cc:5488

References _get_VA_func_ptr, _myPopModelFuncPtr, LifeCycleEvent::_popPtr, _QuantiProto, TProtoQuanti::get_dominance_model(), SimComponent::get_parameter(), IndFactory::getTraitPrototype(), TTQuantiSH::getVaNoDominance(), TTQuantiSH::getVaWithDominance(), Param::isSet(), NonWrightFisherPopulation(), LCE_Breed_base::setParameters(), and WrightFisherPopulation().

◆ setVefromVa()

void LCE_Breed_Quanti::setVefromVa ( Patch patch,
age_idx  AGE 
)
567 {
568  vector<double> Va;
569 
570  if(!(_popPtr->getCurrentGeneration()%_QuantiProto->get_h2_setTime())) // use setTime as periodicity
571  {
572 
573  Va = (_QuantiProto->get_stater()->*_get_VA_func_ptr)(patch, AGE); // compute Va
574 
575 // cout << "LCE_Breed_Quanti::setVefromVa:: Va/Ve = ";
576 
577  // we have to make sure that the phenotype will be calculated with Ve
578  // this is not guaranteed if Ve was not in input
580 
581  // set Ve to match h2 given computed value of Va
582  for(unsigned int j = 0; j < _QuantiProto->get_num_traits(); ++j) {
583 
584 // cout << Va[j] <<"/"<< Va[j] * (1 - _h2[j])/_h2[j] <<" ";
585 
586  _QuantiProto->set_eVarianceSD( j, sqrt(Va[j] * (1 - _h2[j])/_h2[j]) );
587  }
588 
589 // cout<<endl;
590  }
591 
592 }
unsigned int getCurrentGeneration()
Definition: metapop.h:295
void set_trait_value_func_ptr(bool withVe)
Definition: ttquanti.cc:678
TTQuantiSH * get_stater()
Definition: ttquanti.h:449
unsigned int get_h2_setTime()
Definition: ttquanti.h:431
unsigned int get_num_traits()
Definition: ttquanti.h:422
void set_eVarianceSD(unsigned int trait, double SD)
Definition: ttquanti.cc:2379

References _get_VA_func_ptr, _h2, LifeCycleEvent::_popPtr, _QuantiProto, TProtoQuanti::get_h2_setTime(), TProtoQuanti::get_num_traits(), TProtoQuanti::get_stater(), Metapop::getCurrentGeneration(), TProtoQuanti::set_eVarianceSD(), and TProtoQuanti::set_trait_value_func_ptr().

Referenced by NonWrightFisherPopulation(), and WrightFisherPopulation().

+ Here is the caller graph for this function:

◆ WrightFisherPopulation()

void LCE_Breed_Quanti::WrightFisherPopulation ( )
510 {
511  Patch* patch = 0;
512  Individual* mother = 0;
513  Individual* father = 0;
514  Individual* NewOffsprg = 0;
515  unsigned int indexOfMother = 0;
516  unsigned int size = 0;
517 
518 #ifdef _DEBUG_
519  message("LCE_Breed::execute::WrightFisherPopulation::\n");
520 #endif
521 
522 
523  _h2 = _QuantiProto->get_heritability(); //may have been reset during a run
524 
525  for(unsigned int i = 0; i < _popPtr->getPatchNbr(); i++) {
526 
527  patch = _popPtr->getPatch(i);
528 
529  if( !checkMatingCondition(patch) ) continue;
530 
531  size = patch->size(FEM, ADLTx);
532 
533  for(unsigned int s = 0; s < 2; ++s) { //filling male and female offspring containers
534  //-----------------------------------------------------------------------
535  for(unsigned int c = 0; c < patch->get_K(sex_t(s)); ++c)
536  {
537  indexOfMother = RAND::Uniform(size);
538 
539  mother = patch->get(FEM, ADLTx, indexOfMother );
540 
541  father = this->getFatherPtr(patch, mother, indexOfMother);
542 
543  NewOffsprg = makeOffspring( do_breed(mother, father, i) );
544 
545  NewOffsprg->setSex(sex_t(s));
546 
547  patch->add(sex_t(s), OFFSx, NewOffsprg);
548  }//END FOR ind
549  } //END FOR sex
550 
551  // compute Va in each patch to set Ve to match the h2 required
552  setVefromVa(patch, OFFSx);
553 
554  setIndPhenotype(patch, FEM, OFFSx);
555  setIndPhenotype(patch, MAL, OFFSx);
556 
557  } //END FOR patch
558 
559 #ifdef _DEBUG_
560  message("LCE_Breed::execute::WrightFisherPopulation::new offsprg nb: %i \n",_popPtr->size( OFFSPRG ));
561 #endif
562 }
void setSex(sex_t sex)
Definition: individual.h:111
unsigned int get_K()
Definition: metapop.h:481
static double Uniform()
Generates a random number from [0.0, 1.0[ uniformly distributed.
Definition: Uniform.h:126
sex_t
Sex types, males are always 0 and females 1!!
Definition: types.h:35

References _h2, LifeCycleEvent::_popPtr, _QuantiProto, Patch::add(), ADLTx, LCE_Breed_base::checkMatingCondition(), LCE_Breed_base::do_breed(), FEM, Patch::get(), TProtoQuanti::get_heritability(), Patch::get_K(), LCE_Breed_base::getFatherPtr(), Metapop::getPatch(), Metapop::getPatchNbr(), LCE_Breed_base::makeOffspring(), MAL, message(), OFFSPRG, OFFSx, setIndPhenotype(), Individual::setSex(), setVefromVa(), Metapop::size(), Patch::size(), and RAND::Uniform().

Referenced by setParameters().

+ Here is the caller graph for this function:

Member Data Documentation

◆ _get_VA_func_ptr

vector<double>(TTQuantiSH::* LCE_Breed_Quanti::_get_VA_func_ptr) (Patch *, const age_idx)
private

Referenced by setParameters(), and setVefromVa().

◆ _h2

vector<double> LCE_Breed_Quanti::_h2
private

◆ _myPopModelFuncPtr

void(LCE_Breed_Quanti::* LCE_Breed_Quanti::_myPopModelFuncPtr) (void)
private

Referenced by execute(), and setParameters().

◆ _QuantiProto

TProtoQuanti* LCE_Breed_Quanti::_QuantiProto
private

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

Generated for Nemo v2.4.0 by  doxygen 1.9.1 -- Nemo is hosted on  Download Nemo

Locations of visitors to this page
Catalogued on GSR