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

Dispersal event with an evolving dispersal rate given by the "disp" trait. More...

#include <LCEdisperse.h>

+ Inheritance diagram for LCE_Disperse_EvolDisp:
+ Collaboration diagram for LCE_Disperse_EvolDisp:

Public Member Functions

 LCE_Disperse_EvolDisp ()
 
virtual ~LCE_Disperse_EvolDisp ()
 
Implementations
virtual bool setParameters ()
 
virtual void execute ()
 
virtual LifeCycleEventclone ()
 
- Public Member Functions inherited from LCE_Disperse_base
 LCE_Disperse_base ()
 
virtual ~LCE_Disperse_base ()
 Deallocates the disp matrix. More...
 
bool setBaseParameters (string prefix)
 
void setParamPrefix (string pref)
 
void addParameters (string prefix, ParamUpdaterBase *updater)
 
void setIndentityDispMatrix (TMatrix *mat)
 
unsigned int getMigrationPatchForward (sex_t SEX, unsigned int LocalPatch)
 
unsigned int getMigrationPatchBackward (sex_t SEX, unsigned int LocalPatch)
 
unsigned int getMigrationIndex (vector< double > &rates)
 
unsigned int getMigrationIndexGSLdiscrete (gsl_ran_discrete_t *rates)
 
void setPropaguleTargets ()
 
void swapPostDisp ()
 
void reset_counters ()
 
void set_isForward (bool val)
 
bool checkForwardDispersalMatrix (TMatrix *mat)
 
bool checkBackwardDispersalMatrix (TMatrix *mat)
 
void allocateDispMatrix (sex_t sex, unsigned int dim)
 
bool updateDispMatrix ()
 
bool setDispMatrix ()
 
bool setReducedMatricesBySex (sex_t SEX, Param &connectivity, Param &rate)
 
bool setReducedDispMatrix ()
 The reduced dispersal matrix contains the indices of the patches to which each patch is connected. More...
 
bool setIsland_MigrantPool_Matrix ()
 
bool setIsland_PropagulePool_Matrix ()
 
bool setSteppingStone1DMatrix ()
 
bool setLatticeMatrix ()
 Sets the dispersal matrices for the Lattice dispersal model. More...
 
bool setBasicLatticeMatrix (int rows, int cols, double phi_mal, double phi_fem, double disp_mal, double disp_fem)
 
bool setLatticeTorrusMatrix (int rows, int cols, double disp_mal, double disp_fem, TMatrix *grid)
 
bool setLatticeAbsorbingMatrix ()
 
bool setLatticeReflectingMatrix (int rows, int cols, TMatrix *grid)
 
bool isForward ()
 
bool isByNumber ()
 
unsigned int getDispersalModel ()
 
double getPropaguleProb ()
 
unsigned int getPropaguleTarget (unsigned int home)
 
vector< double > getConnectedPatches (sex_t SEX, unsigned int local_patch)
 
vector< double > getConnectedRates (sex_t SEX, unsigned int local_patch)
 
double getReducedDispersalRate (sex_t SEX, unsigned int row, unsigned int col)
 
unsigned int getReducedDispersalPatchID (sex_t SEX, unsigned int row, unsigned int col)
 
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 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 Member Functions

unsigned int Migrate_Island (unsigned int home)
 
unsigned int Migrate_Island_Propagule (unsigned int home)
 
unsigned int Migrate_SteppingStone1D (unsigned int home)
 
unsigned int Migrate_Lattice (unsigned int home)
 
void exec_evolmale ()
 
void exec_evolfemale ()
 
void exec_evol2sex ()
 
void evoldisp (sex_t SEX, int trait_link, double cost)
 
void fixdisp (sex_t SEX, double rate, double cost)
 

Private Attributes

double _fem_cost
 
double _mal_cost
 
double _fixed_disp_rate
 
unsigned int(LCE_Disperse_EvolDisp::* getAimedPatch )(unsigned int)
 
void(LCE_Disperse_EvolDisp::* exec )()
 
int _fdisp_trait_link
 
int _mdisp_trait_link
 

Additional Inherited Members

- Protected Attributes inherited from LCE_Disperse_base
unsigned int _npatch
 Number of patches in the population. More...
 
vector< vector< double > > _reducedDispMat [2]
 Matrix containing the indexes of the patches connected to each patch. More...
 
vector< vector< double > > _reducedDispMatProba [2]
 Matrix containing the probability to migrate to/from the connected patches. More...
 
- 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

Dispersal event with an evolving dispersal rate given by the "disp" trait.

The dispersal models implemented so far are:

  • 1: Island Model with migrant pool
  • 2: Island Model with propagule pool
  • 3: Stepping stone model in 1 dimension (ring population)

Constructor & Destructor Documentation

◆ LCE_Disperse_EvolDisp()

LCE_Disperse_EvolDisp::LCE_Disperse_EvolDisp ( )
1572 : LifeCycleEvent("disperse_evoldisp",""), _fem_cost(-1.0), _mal_cost(-1.0), _fixed_disp_rate(0),
1574 {
1577 
1578  LCE_Disperse_base::addParameters("dispersal", updater);
1579 
1580  add_parameter("dispersal_cost",DBL,false,true,0,1, updater);
1581  add_parameter("dispersal_cost_fem",DBL,false,true,0,1, updater);
1582  add_parameter("dispersal_cost_mal",DBL,false,true,0,1, updater);
1583  add_parameter("dispersal_fixed_trait",STR,false,false,0,0, updater);
1584  add_parameter("dispersal_fixed_rate",DBL,false,true,0,1, updater);
1585 }
double _fixed_disp_rate
Definition: LCEdisperse.h:199
unsigned int(LCE_Disperse_EvolDisp::* getAimedPatch)(unsigned int)
Definition: LCEdisperse.h:200
double _fem_cost
Definition: LCEdisperse.h:199
virtual bool setParameters()
Definition: LCEdisperse.cc:1589
int _fdisp_trait_link
Definition: LCEdisperse.h:213
int _mdisp_trait_link
Definition: LCEdisperse.h:213
void(LCE_Disperse_EvolDisp::* exec)()
Definition: LCEdisperse.h:201
double _mal_cost
Definition: LCEdisperse.h:199
void addParameters(string prefix, ParamUpdaterBase *updater)
Definition: LCEdisperse.cc:61
LifeCycleEvent(const char *name, const char *trait_link)
Cstor.
Definition: lifecycleevent.h:97
Implementation of the ParamUpdaterBase interface.
Definition: param.h:362
virtual void add_parameter(Param *param)
Interface to add a parameter to the set.
Definition: simcomponent.h:111
@ DBL
Definition: types.h:77
@ STR
Definition: types.h:77

References SimComponent::add_parameter(), LCE_Disperse_base::addParameters(), DBL, setParameters(), and STR.

Referenced by clone().

+ Here is the caller graph for this function:

◆ ~LCE_Disperse_EvolDisp()

virtual LCE_Disperse_EvolDisp::~LCE_Disperse_EvolDisp ( )
inlinevirtual
219 {}

Member Function Documentation

◆ clone()

virtual LifeCycleEvent* LCE_Disperse_EvolDisp::clone ( )
inlinevirtual

Implements LifeCycleEvent.

225 {return new LCE_Disperse_EvolDisp();}
LCE_Disperse_EvolDisp()
Definition: LCEdisperse.cc:1571

References LCE_Disperse_EvolDisp().

◆ evoldisp()

void LCE_Disperse_EvolDisp::evoldisp ( sex_t  SEX,
int  trait_link,
double  cost 
)
private
1757 {
1758 
1759  Patch *current_patch;
1760  unsigned int AimedPatch;
1761  unsigned int sink_patch = _npatch; // this is the sink patch in case of absorbing border model
1762 
1763  for(unsigned int i = 0; i < _npatch; i++) {
1764 
1765  current_patch = _popPtr->getPatch(i);
1766 
1767  while( current_patch->size(SEX, OFFSx) != 0 ) {
1768 
1769  if(RAND::Uniform() < *(double*)current_patch->get(SEX, OFFSx, 0)->getTraitValue(trait_link)) {
1770  //this one disperses
1771  AimedPatch = (this->*getAimedPatch)(i);
1772 
1773  current_patch->nbEmigrant++;
1774 
1775  if(RAND::Uniform() < cost || AimedPatch == sink_patch) {
1776  //also check if sink patch number has been returned
1777 
1778  _popPtr->recycle( current_patch->get(SEX, OFFSx, 0) );
1779 
1780  current_patch->remove(SEX, OFFSx, 0);
1781 
1782  } else {
1783  //survives
1784  _popPtr->move(SEX, OFFSx, i, PDISPx, AimedPatch, 0);
1785 
1786  _popPtr->getPatch(AimedPatch)->nbImigrant++;
1787 
1788  }
1789  } else {
1790  //no dispersal
1791  current_patch->move(SEX,OFFSx,PDISPx,0);
1792  current_patch->nbPhilopat++;
1793  }
1794 
1795  }//end while
1796  }//end for
1797 }
void recycle(Individual *ind)
Put an individual in the recycling pool.
Definition: indfactory.h:61
void * getTraitValue(IDX T)
Accessor to the value (phenotype) of a particular trait.
Definition: individual.h:270
unsigned int _npatch
Number of patches in the population.
Definition: LCEdisperse.h:63
Metapop * _popPtr
The ptr to the current Metapop.
Definition: lifecycleevent.h:80
Patch * getPatch(unsigned int i)
Patch accessor, return the ith+1 patch in the metapop.
Definition: metapop.h:256
void move(sex_t SEX, age_idx from_age, unsigned int from_deme, age_idx to_age, unsigned int to_deme, unsigned int at)
Moves an individual from a deme to an other one, both demes sizes are modified.
Definition: metapop.h:838
Second class in the metapopulation design structure, between the Metapop and Individual classes.
Definition: metapop.h:431
Individual * remove(sex_t SEX, age_idx AGE, unsigned int at)
Removes the individual sitting at the given index in the appropriate container.
Definition: metapop.h:587
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
unsigned short nbEmigrant
Definition: metapop.h:453
void move(sex_t SEX, age_idx from, age_idx to, unsigned int at)
Moves an individual from an age class to an other one.
Definition: metapop.h:610
unsigned short nbPhilopat
Definition: metapop.h:453
unsigned short nbImigrant
Definition: metapop.h:453
static double Uniform()
Generates a random number from [0.0, 1.0[ uniformly distributed.
Definition: Uniform.h:126
@ OFFSx
Definition: types.h:41
@ PDISPx
Definition: types.h:41

References LCE_Disperse_base::_npatch, LifeCycleEvent::_popPtr, Patch::get(), getAimedPatch, Metapop::getPatch(), Individual::getTraitValue(), Patch::move(), Metapop::move(), Patch::nbEmigrant, Patch::nbImigrant, Patch::nbPhilopat, OFFSx, PDISPx, IndFactory::recycle(), Patch::remove(), Patch::size(), and RAND::Uniform().

Referenced by exec_evol2sex(), exec_evolfemale(), and exec_evolmale().

+ Here is the caller graph for this function:

◆ exec_evol2sex()

void LCE_Disperse_EvolDisp::exec_evol2sex ( )
private
1749 {
1752 }
void evoldisp(sex_t SEX, int trait_link, double cost)
Definition: LCEdisperse.cc:1756
@ FEM
Definition: types.h:36
@ MAL
Definition: types.h:36

References _fdisp_trait_link, _fem_cost, _mal_cost, _mdisp_trait_link, evoldisp(), FEM, and MAL.

Referenced by setParameters().

+ Here is the caller graph for this function:

◆ exec_evolfemale()

void LCE_Disperse_EvolDisp::exec_evolfemale ( )
private
1733 {
1736 }
void fixdisp(sex_t SEX, double rate, double cost)
Definition: LCEdisperse.cc:1801

References _fdisp_trait_link, _fem_cost, _fixed_disp_rate, _mal_cost, evoldisp(), FEM, fixdisp(), and MAL.

Referenced by setParameters().

+ Here is the caller graph for this function:

◆ exec_evolmale()

void LCE_Disperse_EvolDisp::exec_evolmale ( )
private

References _fem_cost, _fixed_disp_rate, _mal_cost, _mdisp_trait_link, evoldisp(), FEM, fixdisp(), and MAL.

Referenced by setParameters().

+ Here is the caller graph for this function:

◆ execute()

void LCE_Disperse_EvolDisp::execute ( )
virtual

Implements LifeCycleEvent.

1698 {
1699 #ifdef _DEBUG_
1700  message("LCE_Disperse_EvolDisp::execute (Patch nb: %i offsprg nbr: %i)\n"
1702 #endif
1703  if( getDispersalModel() == 2 ) setPropaguleTargets();
1704 
1705 
1706  reset_counters();
1707 
1708  (this->*exec)();
1709 
1710  Patch *current_patch;
1711 
1713 
1714  for(unsigned int i = 0; i < _npatch; i++) {
1715 
1716  current_patch = _popPtr->getPatch(i);
1717 
1718  //set coloniser counter
1719  if(current_patch->get_isExtinct())
1720  current_patch->nbKolonisers = current_patch->size(PDISPx);
1721  else
1722  current_patch->nbKolonisers = -1;
1723 
1724  }//end_for
1725 
1726  swapPostDisp();
1727 
1728 }
void reset_counters()
Definition: LCEdisperse.cc:389
void swapPostDisp()
Definition: LCEdisperse.cc:376
unsigned int getDispersalModel()
Definition: LCEdisperse.h:114
void setPropaguleTargets()
Definition: LCEdisperse.cc:463
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
short nbKolonisers
Definition: metapop.h:454
bool get_isExtinct()
Definition: metapop.h:485
void message(const char *message,...)
Definition: output.cc:39
#define OFFSPRG
Offspring age class flag.
Definition: types.h:49

References LCE_Disperse_base::_npatch, LifeCycleEvent::_popPtr, exec, Patch::get_isExtinct(), LCE_Disperse_base::getDispersalModel(), Metapop::getPatch(), Metapop::getPatchNbr(), message(), Patch::nbKolonisers, OFFSPRG, PDISPx, LCE_Disperse_base::reset_counters(), LCE_Disperse_base::setPropaguleTargets(), Metapop::size(), Patch::size(), and LCE_Disperse_base::swapPostDisp().

◆ fixdisp()

void LCE_Disperse_EvolDisp::fixdisp ( sex_t  SEX,
double  rate,
double  cost 
)
private
1802 {
1803 
1804  Patch *current_patch;
1805  unsigned int AimedPatch;
1806 
1807  for(unsigned int i = 0; i < _npatch; i++) {
1808 
1809  current_patch = _popPtr->getPatch(i);
1810 
1811  while( current_patch->size(SEX, OFFSx) != 0 ) {
1812 
1813  if(RAND::Uniform() < rate) {
1814  //this one disperses
1815  AimedPatch = (this->*getAimedPatch)(i);
1816 
1817  current_patch->nbEmigrant++;
1818 
1819  if(RAND::Uniform() > cost) {
1820  //survives
1821  _popPtr->move(SEX, OFFSx, i, PDISPx, AimedPatch, 0);
1822 
1823  _popPtr->getPatch(AimedPatch)->nbImigrant++;
1824  } else {
1825 
1826  _popPtr->recycle( current_patch->get(SEX, OFFSx, 0) );
1827 
1828  current_patch->remove(SEX, OFFSx, 0);
1829  }
1830  } else {
1831  //no dispersal
1832  current_patch->move(SEX,OFFSx,PDISPx,0);
1833  current_patch->nbPhilopat++;
1834  }
1835 
1836  }//end while
1837  }//end for
1838 }

References LCE_Disperse_base::_npatch, LifeCycleEvent::_popPtr, Patch::get(), getAimedPatch, Metapop::getPatch(), Patch::move(), Metapop::move(), Patch::nbEmigrant, Patch::nbImigrant, Patch::nbPhilopat, OFFSx, PDISPx, IndFactory::recycle(), Patch::remove(), Patch::size(), and RAND::Uniform().

Referenced by exec_evolfemale(), and exec_evolmale().

+ Here is the caller graph for this function:

◆ Migrate_Island()

unsigned int LCE_Disperse_EvolDisp::Migrate_Island ( unsigned int  home)
private
1843 {
1844  unsigned int AimedPatch;
1845  //assign a Patch of arrival at random
1846  do{
1847  AimedPatch = RAND::Uniform(_npatch);
1848  }while(AimedPatch == home);
1849 
1850  return AimedPatch;
1851 }

References LCE_Disperse_base::_npatch, and RAND::Uniform().

Referenced by setParameters().

+ Here is the caller graph for this function:

◆ Migrate_Island_Propagule()

unsigned int LCE_Disperse_EvolDisp::Migrate_Island_Propagule ( unsigned int  home)
private
1856 {
1857  unsigned int AimedPatch, PropaguleTarget = getPropaguleTarget(home);
1858 
1859  if(!(RAND::Uniform() > getPropaguleProb()) )
1860  AimedPatch = PropaguleTarget;
1861  else
1862  do{
1863  AimedPatch = RAND::Uniform(_npatch);
1864  }while(AimedPatch == home || AimedPatch == PropaguleTarget);
1865 
1866  return AimedPatch;
1867 }
unsigned int getPropaguleTarget(unsigned int home)
Definition: LCEdisperse.h:116
double getPropaguleProb()
Definition: LCEdisperse.h:115

References LCE_Disperse_base::_npatch, LCE_Disperse_base::getPropaguleProb(), LCE_Disperse_base::getPropaguleTarget(), and RAND::Uniform().

Referenced by setParameters().

+ Here is the caller graph for this function:

◆ Migrate_Lattice()

unsigned int LCE_Disperse_EvolDisp::Migrate_Lattice ( unsigned int  home)
private
1884 {
1885  //take one of the two, no difference b/n males and females
1886  return( _reducedDispMat[0][home][ RAND::Uniform( _reducedDispMat[0][home].size() ) ] );
1887 }
vector< vector< double > > _reducedDispMat[2]
Matrix containing the indexes of the patches connected to each patch.
Definition: LCEdisperse.h:66

References LCE_Disperse_base::_reducedDispMat, and RAND::Uniform().

Referenced by setParameters().

+ Here is the caller graph for this function:

◆ Migrate_SteppingStone1D()

unsigned int LCE_Disperse_EvolDisp::Migrate_SteppingStone1D ( unsigned int  home)
private
1872 {
1873  int neighbours[2] = {(int)(home - 1),(int)(home + 1)};
1874  //if we are at one of the bound of the Patch array, we may migrate to the other bound:
1875  if(neighbours[0] < 0) neighbours[0] = _npatch -1;
1876  else if(neighbours[1] == (int)_npatch) neighbours[1] = 0;
1877 
1878  return(RAND::RandBool() ? neighbours[0] : neighbours[1]);
1879 }
static bool RandBool()
Returns a random boolean.
Definition: Uniform.h:164

References LCE_Disperse_base::_npatch, and RAND::RandBool().

Referenced by setParameters().

+ Here is the caller graph for this function:

◆ setParameters()

bool LCE_Disperse_EvolDisp::setParameters ( )
virtual

Implements SimComponent.

1590 {
1591  //we do not call the LCE_Disperse_base::setParameters here because we don't use
1592  //dispersal matrices in input
1594 
1595  _prefix = "dispersal";
1596 
1597  _disp_model = (int)_paramSet->getValue("dispersal_model");
1598 
1599  _disp_propagule_prob = _paramSet->getValue("dispersal_propagule_prob");
1600 
1601  if(_disp_model == -1 && !_paramSet->isSet("dispersal_connectivity_matrix")) {
1602  return error("disperse_evoldisp: a dispersal model or a patch connectivity matrix must be specified!\n");
1603  }
1604 
1605  if(_disp_model == 2 && _disp_propagule_prob == -1) {
1606  return error("dispersal propagule probability is missing!\n");
1607  }
1608 
1611 
1612  // connectivity matrix is specified in input --------------------------------------------
1613  if(_paramSet->isSet(_prefix + "_connectivity_matrix")) {
1614 
1615  _disp_model=0;
1616 
1617  get_parameter(_prefix + "_connectivity_matrix")->getVariableMatrix(&_reducedDispMat[0]);
1618 
1619  //need to copy matrices for the other sex (a single matrix is given in input)
1620 
1621  _reducedDispMat[FEM].clear();
1622 
1623  for (unsigned int i = 0; i < _reducedDispMat[0].size(); ++i) {
1624 
1625  _reducedDispMat[FEM].push_back(vector<double>());
1626 
1627  for (unsigned int j = 0; j < _reducedDispMat[0][i].size(); ++j) {
1628  // _reducedDispMat[0][i][j]--; //remove 1 to make sure that the indexes start with 0, not 1!!!!
1629  _reducedDispMat[FEM][i].push_back( _reducedDispMat[0][i][j] );
1630  }
1631  }
1632  }
1633 
1634  if(_paramSet->isSet("dispersal_cost")) {
1635 
1636  _fem_cost = _mal_cost = _paramSet->getValue("dispersal_cost");
1637 
1638  } else if(_paramSet->isSet("dispersal_cost_fem") && _paramSet->isSet("dispersal_cost_mal")) {
1639 
1640  _fem_cost = _paramSet->getValue("dispersal_cost_fem");
1641 
1642  _mal_cost = _paramSet->getValue("dispersal_cost_mal");
1643 
1644  } else {
1645  return error("dispersal cost params are not set !\n");
1646  }
1647 
1648  if(_paramSet->isSet("dispersal_fixed_trait")) {
1649 
1650  if(_paramSet->getArg("dispersal_fixed_trait").compare("female") == 0) {
1651 
1653 
1654  } else if(_paramSet->getArg("dispersal_fixed_trait").compare("male") == 0) {
1655 
1657 
1658  } else {
1659  error("wrong argument value for \"dispersal_fixed_trait\"\n");
1660  return false;
1661  }
1662 
1663  _fixed_disp_rate = _paramSet->getValue("dispersal_fixed_rate");
1664 
1665  } else
1667 
1668  switch ( getDispersalModel() ) {
1669  case 0:
1670  case 1:
1672  break;
1673  case 2:
1675  break;
1676  case 3:
1678  break;
1679  case 4:
1680  {
1681  if(!LCE_Disperse_base::setLatticeMatrix()) return false;
1682  if(!LCE_Disperse_base::setReducedDispMatrix()) return false;
1684  break;
1685  }
1686  default: {
1687  error("\nDispersal model %i not yet implemented with evolving dispersal!\n",
1688  getDispersalModel());
1689  return false;
1690  }
1691  }
1692  return true;
1693 }
int getTraitIndex(trait_t type)
Gives the index of trait with type.
Definition: indfactory.cc:127
unsigned int Migrate_Island_Propagule(unsigned int home)
Definition: LCEdisperse.cc:1855
unsigned int Migrate_Island(unsigned int home)
Definition: LCEdisperse.cc:1842
void exec_evolmale()
Definition: LCEdisperse.cc:1740
unsigned int Migrate_Lattice(unsigned int home)
Definition: LCEdisperse.cc:1883
unsigned int Migrate_SteppingStone1D(unsigned int home)
Definition: LCEdisperse.cc:1871
void exec_evol2sex()
Definition: LCEdisperse.cc:1748
void exec_evolfemale()
Definition: LCEdisperse.cc:1732
bool setReducedDispMatrix()
The reduced dispersal matrix contains the indices of the patches to which each patch is connected.
Definition: LCEdisperse.cc:1108
double _disp_propagule_prob
Definition: LCEdisperse.h:46
int _disp_model
Definition: LCEdisperse.h:45
bool setLatticeMatrix()
Sets the dispersal matrices for the Lattice dispersal model.
Definition: LCEdisperse.cc:722
string _prefix
Parameter name prefix (dispersal, seed_disp, breed_disp, etc.)
Definition: LCEdisperse.h:56
string getArg(string name)
Accessor to the parameters argument string.
Definition: param.h:299
double getValue(string name)
Accessor the parameters value.
Definition: param.h:301
bool isSet()
Accessor to the status flag.
Definition: param.h:287
void getVariableMatrix(vector< vector< double > > *mat)
Definition: param.cc:461
virtual Param * get_parameter(std::string name)
Param getter.
Definition: simcomponent.h:138
ParamSet * _paramSet
The parameters container.
Definition: simcomponent.h:47
int error(const char *str,...)
Definition: output.cc:78

References LCE_Disperse_base::_disp_model, LCE_Disperse_base::_disp_propagule_prob, _fdisp_trait_link, _fem_cost, _fixed_disp_rate, _mal_cost, _mdisp_trait_link, LCE_Disperse_base::_npatch, SimComponent::_paramSet, LifeCycleEvent::_popPtr, LCE_Disperse_base::_prefix, LCE_Disperse_base::_reducedDispMat, error(), exec, exec_evol2sex(), exec_evolfemale(), exec_evolmale(), FEM, SimComponent::get_parameter(), getAimedPatch, ParamSet::getArg(), LCE_Disperse_base::getDispersalModel(), Metapop::getPatchNbr(), IndFactory::getTraitIndex(), ParamSet::getValue(), Param::getVariableMatrix(), ParamSet::isSet(), Migrate_Island(), Migrate_Island_Propagule(), Migrate_Lattice(), Migrate_SteppingStone1D(), LCE_Disperse_base::setLatticeMatrix(), and LCE_Disperse_base::setReducedDispMatrix().

Referenced by LCE_Disperse_EvolDisp().

+ Here is the caller graph for this function:

Member Data Documentation

◆ _fdisp_trait_link

int LCE_Disperse_EvolDisp::_fdisp_trait_link
private

◆ _fem_cost

double LCE_Disperse_EvolDisp::_fem_cost
private

◆ _fixed_disp_rate

double LCE_Disperse_EvolDisp::_fixed_disp_rate
private

◆ _mal_cost

double LCE_Disperse_EvolDisp::_mal_cost
private

◆ _mdisp_trait_link

int LCE_Disperse_EvolDisp::_mdisp_trait_link
private

◆ exec

void(LCE_Disperse_EvolDisp::* LCE_Disperse_EvolDisp::exec) ()
private

Referenced by execute(), and setParameters().

◆ getAimedPatch

unsigned int(LCE_Disperse_EvolDisp::* LCE_Disperse_EvolDisp::getAimedPatch) (unsigned int)
private

Referenced by evoldisp(), fixdisp(), and setParameters().


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