Nemo  2.4.0b
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 ( )
1571 : LifeCycleEvent("disperse_evoldisp",""), _fem_cost(-1.0), _mal_cost(-1.0), _fixed_disp_rate(0),
1573 {
1576 
1577  LCE_Disperse_base::addParameters("dispersal", updater);
1578 
1579  add_parameter("dispersal_cost",DBL,false,true,0,1, updater);
1580  add_parameter("dispersal_cost_fem",DBL,false,true,0,1, updater);
1581  add_parameter("dispersal_cost_mal",DBL,false,true,0,1, updater);
1582  add_parameter("dispersal_fixed_trait",STR,false,false,0,0, updater);
1583  add_parameter("dispersal_fixed_rate",DBL,false,true,0,1, updater);
1584 }
double _fixed_disp_rate
Definition: LCEdisperse.h:200
unsigned int(LCE_Disperse_EvolDisp::* getAimedPatch)(unsigned int)
Definition: LCEdisperse.h:201
double _fem_cost
Definition: LCEdisperse.h:200
virtual bool setParameters()
Definition: LCEdisperse.cc:1588
int _fdisp_trait_link
Definition: LCEdisperse.h:214
int _mdisp_trait_link
Definition: LCEdisperse.h:214
void(LCE_Disperse_EvolDisp::* exec)()
Definition: LCEdisperse.h:202
double _mal_cost
Definition: LCEdisperse.h:200
void addParameters(string prefix, ParamUpdaterBase *updater)
Definition: LCEdisperse.cc:62
LifeCycleEvent(const char *name, const char *trait_link)
Cstor.
Definition: lifecycleevent.h:98
Implementation of the ParamUpdaterBase interface.
Definition: param.h:363
virtual void add_parameter(Param *param)
Interface to add a parameter to the set.
Definition: simcomponent.h:112
@ DBL
Definition: types.h:78
@ STR
Definition: types.h:78

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

Referenced by clone().

◆ ~LCE_Disperse_EvolDisp()

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

Member Function Documentation

◆ clone()

virtual LifeCycleEvent* LCE_Disperse_EvolDisp::clone ( )
inlinevirtual

Implements LifeCycleEvent.

226 {return new LCE_Disperse_EvolDisp();}
LCE_Disperse_EvolDisp()
Definition: LCEdisperse.cc:1570

References LCE_Disperse_EvolDisp().

◆ evoldisp()

void LCE_Disperse_EvolDisp::evoldisp ( sex_t  SEX,
int  trait_link,
double  cost 
)
private
1756 {
1757 
1758  Patch *current_patch;
1759  unsigned int AimedPatch;
1760  unsigned int sink_patch = _npatch; // this is the sink patch in case of absorbing border model
1761 
1762  for(unsigned int i = 0; i < _npatch; i++) {
1763 
1764  current_patch = _popPtr->getPatch(i);
1765 
1766  while( current_patch->size(SEX, OFFSx) != 0 ) {
1767 
1768  if(RAND::Uniform() < *(double*)current_patch->get(SEX, OFFSx, 0)->getTraitValue(trait_link)) {
1769  //this one disperses
1770  AimedPatch = (this->*getAimedPatch)(i);
1771 
1772  current_patch->nbEmigrant++;
1773 
1774  if(RAND::Uniform() < cost || AimedPatch == sink_patch) {
1775  //also check if sink patch number has been returned
1776 
1777  _popPtr->recycle( current_patch->get(SEX, OFFSx, 0) );
1778 
1779  current_patch->remove(SEX, OFFSx, 0);
1780 
1781  } else {
1782  //survives
1783  _popPtr->move(SEX, OFFSx, i, PDISPx, AimedPatch, 0);
1784 
1785  _popPtr->getPatch(AimedPatch)->nbImigrant++;
1786 
1787  }
1788  } else {
1789  //no dispersal
1790  current_patch->move(SEX,OFFSx,PDISPx,0);
1791  current_patch->nbPhilopat++;
1792  }
1793 
1794  }//end while
1795  }//end for
1796 }
void recycle(Individual *ind)
Put an individual in the recycling pool.
Definition: indfactory.h:62
void * getTraitValue(IDX T)
Accessor to the value (phenotype) of a particular trait.
Definition: individual.h:271
unsigned int _npatch
Number of patches in the population.
Definition: LCEdisperse.h:64
Metapop * _popPtr
The ptr to the current Metapop.
Definition: lifecycleevent.h:81
Patch * getPatch(unsigned int i)
Patch accessor, return the ith+1 patch in the metapop.
Definition: metapop.h:257
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:837
Second class in the metapopulation design structure, between the Metapop and Individual classes.
Definition: metapop.h:432
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:588
unsigned int size(age_t AGE)
Returns the size of the container of the appropriate age class(es) for both sexes.
Definition: metapop.h:498
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:534
unsigned short nbEmigrant
Definition: metapop.h:454
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:611
unsigned short nbPhilopat
Definition: metapop.h:454
unsigned short nbImigrant
Definition: metapop.h:454
static double Uniform()
Generates a random number from [0.0, 1.0[ uniformly distributed.
Definition: Uniform.h:124
@ OFFSx
Definition: types.h:42
@ PDISPx
Definition: types.h:42

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

◆ exec_evol2sex()

void LCE_Disperse_EvolDisp::exec_evol2sex ( )
private
1748 {
1751 }
void evoldisp(sex_t SEX, int trait_link, double cost)
Definition: LCEdisperse.cc:1755
@ FEM
Definition: types.h:37
@ MAL
Definition: types.h:37

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

Referenced by setParameters().

◆ exec_evolfemale()

void LCE_Disperse_EvolDisp::exec_evolfemale ( )
private
1732 {
1735 }
void fixdisp(sex_t SEX, double rate, double cost)
Definition: LCEdisperse.cc:1800

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

Referenced by setParameters().

◆ exec_evolmale()

void LCE_Disperse_EvolDisp::exec_evolmale ( )
private

◆ execute()

void LCE_Disperse_EvolDisp::execute ( )
virtual

Implements LifeCycleEvent.

1697 {
1698 #ifdef _DEBUG_
1699  message("LCE_Disperse_EvolDisp::execute (Patch nb: %i offsprg nbr: %i)\n"
1701 #endif
1702  if( getDispersalModel() == 2 ) setPropaguleTargets();
1703 
1704 
1705  reset_counters();
1706 
1707  (this->*exec)();
1708 
1709  Patch *current_patch;
1710 
1712 
1713  for(unsigned int i = 0; i < _npatch; i++) {
1714 
1715  current_patch = _popPtr->getPatch(i);
1716 
1717  //set coloniser counter
1718  if(current_patch->get_isExtinct())
1719  current_patch->nbKolonisers = current_patch->size(PDISPx);
1720  else
1721  current_patch->nbKolonisers = -1;
1722 
1723  }//end_for
1724 
1725  swapPostDisp();
1726 
1727 }
void reset_counters()
Definition: LCEdisperse.cc:390
void swapPostDisp()
Definition: LCEdisperse.cc:377
unsigned int getDispersalModel()
Definition: LCEdisperse.h:115
void setPropaguleTargets()
Definition: LCEdisperse.cc:464
unsigned int size()
Get the total number of individuals present in the population, all sex and age classes together.
Definition: metapop.h:312
unsigned int getPatchNbr()
Definition: metapop.h:276
short nbKolonisers
Definition: metapop.h:455
bool get_isExtinct()
Definition: metapop.h:486
void message(const char *message,...)
Definition: output.cc:40
#define OFFSPRG
Offspring age class flag.
Definition: types.h:50

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

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

◆ Migrate_Island()

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

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

Referenced by setParameters().

◆ Migrate_Island_Propagule()

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

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

Referenced by setParameters().

◆ Migrate_Lattice()

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

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

Referenced by setParameters().

◆ Migrate_SteppingStone1D()

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

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

Referenced by setParameters().

◆ setParameters()

bool LCE_Disperse_EvolDisp::setParameters ( )
virtual

Implements SimComponent.

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

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

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.0b by  doxygen 1.9.1 -- Nemo is hosted on  Download Nemo

Locations of visitors to this page
Catalogued on GSR