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 ( )
1573 : LifeCycleEvent("disperse_evoldisp",""), _fem_cost(-1.0), _mal_cost(-1.0), _fixed_disp_rate(0),
1575 {
1578 
1579  LCE_Disperse_base::addParameters("dispersal", updater);
1580 
1581  add_parameter("dispersal_cost",DBL,false,true,0,1, updater);
1582  add_parameter("dispersal_cost_fem",DBL,false,true,0,1, updater);
1583  add_parameter("dispersal_cost_mal",DBL,false,true,0,1, updater);
1584  add_parameter("dispersal_fixed_trait",STR,false,false,0,0, updater);
1585  add_parameter("dispersal_fixed_rate",DBL,false,true,0,1, updater);
1586 }
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:1590
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:1572

References LCE_Disperse_EvolDisp().

◆ evoldisp()

void LCE_Disperse_EvolDisp::evoldisp ( sex_t  SEX,
int  trait_link,
double  cost 
)
private
1758 {
1759 
1760  Patch *current_patch;
1761  unsigned int AimedPatch;
1762  unsigned int sink_patch = _npatch; // this is the sink patch in case of absorbing border model
1763 
1764  for(unsigned int i = 0; i < _npatch; i++) {
1765 
1766  current_patch = _popPtr->getPatch(i);
1767 
1768  while( current_patch->size(SEX, OFFSx) != 0 ) {
1769 
1770  if(RAND::Uniform() < *(double*)current_patch->get(SEX, OFFSx, 0)->getTraitValue(trait_link)) {
1771  //this one disperses
1772  AimedPatch = (this->*getAimedPatch)(i);
1773 
1774  current_patch->nbEmigrant++;
1775 
1776  if(RAND::Uniform() < cost || AimedPatch == sink_patch) {
1777  //also check if sink patch number has been returned
1778 
1779  _popPtr->recycle( current_patch->get(SEX, OFFSx, 0) );
1780 
1781  current_patch->remove(SEX, OFFSx, 0);
1782 
1783  } else {
1784  //survives
1785  _popPtr->move(SEX, OFFSx, i, PDISPx, AimedPatch, 0);
1786 
1787  _popPtr->getPatch(AimedPatch)->nbImigrant++;
1788 
1789  }
1790  } else {
1791  //no dispersal
1792  current_patch->move(SEX,OFFSx,PDISPx,0);
1793  current_patch->nbPhilopat++;
1794  }
1795 
1796  }//end while
1797  }//end for
1798 }
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:839
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:127
@ 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
1750 {
1753 }
void evoldisp(sex_t SEX, int trait_link, double cost)
Definition: LCEdisperse.cc:1757
@ 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
1734 {
1737 }
void fixdisp(sex_t SEX, double rate, double cost)
Definition: LCEdisperse.cc:1802

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.

1699 {
1700 #ifdef _DEBUG_
1701  message("LCE_Disperse_EvolDisp::execute (Patch nb: %i offsprg nbr: %i)\n"
1703 #endif
1704  if( getDispersalModel() == 2 ) setPropaguleTargets();
1705 
1706 
1707  reset_counters();
1708 
1709  (this->*exec)();
1710 
1711  Patch *current_patch;
1712 
1714 
1715  for(unsigned int i = 0; i < _npatch; i++) {
1716 
1717  current_patch = _popPtr->getPatch(i);
1718 
1719  //set coloniser counter
1720  if(current_patch->get_isExtinct())
1721  current_patch->nbKolonisers = current_patch->size(PDISPx);
1722  else
1723  current_patch->nbKolonisers = -1;
1724 
1725  }//end_for
1726 
1727  swapPostDisp();
1728 
1729 }
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
1803 {
1804 
1805  Patch *current_patch;
1806  unsigned int AimedPatch;
1807 
1808  for(unsigned int i = 0; i < _npatch; i++) {
1809 
1810  current_patch = _popPtr->getPatch(i);
1811 
1812  while( current_patch->size(SEX, OFFSx) != 0 ) {
1813 
1814  if(RAND::Uniform() < rate) {
1815  //this one disperses
1816  AimedPatch = (this->*getAimedPatch)(i);
1817 
1818  current_patch->nbEmigrant++;
1819 
1820  if(RAND::Uniform() > cost) {
1821  //survives
1822  _popPtr->move(SEX, OFFSx, i, PDISPx, AimedPatch, 0);
1823 
1824  _popPtr->getPatch(AimedPatch)->nbImigrant++;
1825  } else {
1826 
1827  _popPtr->recycle( current_patch->get(SEX, OFFSx, 0) );
1828 
1829  current_patch->remove(SEX, OFFSx, 0);
1830  }
1831  } else {
1832  //no dispersal
1833  current_patch->move(SEX,OFFSx,PDISPx,0);
1834  current_patch->nbPhilopat++;
1835  }
1836 
1837  }//end while
1838  }//end for
1839 }

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
1844 {
1845  unsigned int AimedPatch;
1846  //assign a Patch of arrival at random
1847  do{
1848  AimedPatch = RAND::Uniform(_npatch);
1849  }while(AimedPatch == home);
1850 
1851  return AimedPatch;
1852 }

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
1857 {
1858  unsigned int AimedPatch, PropaguleTarget = getPropaguleTarget(home);
1859 
1860  if(!(RAND::Uniform() > getPropaguleProb()) )
1861  AimedPatch = PropaguleTarget;
1862  else
1863  do{
1864  AimedPatch = RAND::Uniform(_npatch);
1865  }while(AimedPatch == home || AimedPatch == PropaguleTarget);
1866 
1867  return AimedPatch;
1868 }
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
1885 {
1886  //take one of the two, no difference b/n males and females
1887  return( _reducedDispMat[0][home][ RAND::Uniform( _reducedDispMat[0][home].size() ) ] );
1888 }
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
1873 {
1874  int neighbours[2] = {(int)(home - 1),(int)(home + 1)};
1875  //if we are at one of the bound of the Patch array, we may migrate to the other bound:
1876  if(neighbours[0] < 0) neighbours[0] = _npatch -1;
1877  else if(neighbours[1] == (int)_npatch) neighbours[1] = 0;
1878 
1879  return(RAND::RandBool() ? neighbours[0] : neighbours[1]);
1880 }
static bool RandBool()
Returns a random boolean.
Definition: Uniform.h:165

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

Referenced by setParameters().

◆ setParameters()

bool LCE_Disperse_EvolDisp::setParameters ( )
virtual

Implements SimComponent.

1591 {
1592  //we do not call the LCE_Disperse_base::setParameters here because we don't use
1593  //dispersal matrices in input
1595 
1596  _prefix = "dispersal";
1597 
1598  _disp_model = (int)_paramSet->getValue("dispersal_model");
1599 
1600  _disp_propagule_prob = _paramSet->getValue("dispersal_propagule_prob");
1601 
1602  if(_disp_model == -1 && !_paramSet->isSet("dispersal_connectivity_matrix")) {
1603  return error("disperse_evoldisp: a dispersal model or a patch connectivity matrix must be specified!\n");
1604  }
1605 
1606  if(_disp_model == 2 && _disp_propagule_prob == -1) {
1607  return error("dispersal propagule probability is missing!\n");
1608  }
1609 
1612 
1613  // connectivity matrix is specified in input --------------------------------------------
1614  if(_paramSet->isSet(_prefix + "_connectivity_matrix")) {
1615 
1616  _disp_model=0;
1617 
1618  get_parameter(_prefix + "_connectivity_matrix")->getVariableMatrix(&_reducedDispMat[0]);
1619 
1620  //need to copy matrices for the other sex (a single matrix is given in input)
1621 
1622  _reducedDispMat[FEM].clear();
1623 
1624  for (unsigned int i = 0; i < _reducedDispMat[0].size(); ++i) {
1625 
1626  _reducedDispMat[FEM].push_back(vector<double>());
1627 
1628  for (unsigned int j = 0; j < _reducedDispMat[0][i].size(); ++j) {
1629  // _reducedDispMat[0][i][j]--; //remove 1 to make sure that the indexes start with 0, not 1!!!!
1630  _reducedDispMat[FEM][i].push_back( _reducedDispMat[0][i][j] );
1631  }
1632  }
1633  }
1634 
1635  if(_paramSet->isSet("dispersal_cost")) {
1636 
1637  _fem_cost = _mal_cost = _paramSet->getValue("dispersal_cost");
1638 
1639  } else if(_paramSet->isSet("dispersal_cost_fem") && _paramSet->isSet("dispersal_cost_mal")) {
1640 
1641  _fem_cost = _paramSet->getValue("dispersal_cost_fem");
1642 
1643  _mal_cost = _paramSet->getValue("dispersal_cost_mal");
1644 
1645  } else {
1646  return error("dispersal cost params are not set !\n");
1647  }
1648 
1649  if(_paramSet->isSet("dispersal_fixed_trait")) {
1650 
1651  if(_paramSet->getArg("dispersal_fixed_trait").compare("female") == 0) {
1652 
1654 
1655  } else if(_paramSet->getArg("dispersal_fixed_trait").compare("male") == 0) {
1656 
1658 
1659  } else {
1660  error("wrong argument value for \"dispersal_fixed_trait\"\n");
1661  return false;
1662  }
1663 
1664  _fixed_disp_rate = _paramSet->getValue("dispersal_fixed_rate");
1665 
1666  } else
1668 
1669  switch ( getDispersalModel() ) {
1670  case 0:
1671  case 1:
1673  break;
1674  case 2:
1676  break;
1677  case 3:
1679  break;
1680  case 4:
1681  {
1682  if(!LCE_Disperse_base::setLatticeMatrix()) return false;
1683  if(!LCE_Disperse_base::setReducedDispMatrix()) return false;
1685  break;
1686  }
1687  default: {
1688  error("\nDispersal model %i not yet implemented with evolving dispersal!\n",
1689  getDispersalModel());
1690  return false;
1691  }
1692  }
1693  return true;
1694 }
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:1856
unsigned int Migrate_Island(unsigned int home)
Definition: LCEdisperse.cc:1843
void exec_evolmale()
Definition: LCEdisperse.cc:1741
unsigned int Migrate_Lattice(unsigned int home)
Definition: LCEdisperse.cc:1884
unsigned int Migrate_SteppingStone1D(unsigned int home)
Definition: LCEdisperse.cc:1872
void exec_evol2sex()
Definition: LCEdisperse.cc:1749
void exec_evolfemale()
Definition: LCEdisperse.cc:1733
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:462
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:79

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