Nemo  2.3.46
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)
 
unsigned int getMigrationPatchForward (sex_t SEX, unsigned int LocalPatch)
 
unsigned int getMigrationPatchBackward (sex_t SEX, unsigned int LocalPatch)
 
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 setDispMatrix ()
 
bool setReducedDispMatrix ()
 The reduced dispersal matrix contains the indices of the patches to which each patch is connected. More...
 
bool updateDispMatrix ()
 
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 side, double phi_mal, double phi_fem, double disp_mal, double disp_fem)
 
bool setLatticeTorrusMatrix (int side, double disp_mal, double disp_fem, TMatrix *grid)
 
bool setLatticeAbsorbingMatrix ()
 
bool setLatticeReflectingMatrix (int side, TMatrix *grid)
 
unsigned int getDispersalModel ()
 
double getPropaguleProb ()
 
unsigned int getPropaguleTarget (unsigned int home)
 
virtual void loadFileServices (FileServices *loader)
 
virtual void loadStatServices (StatServices *loader)
 
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...
 

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

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

Referenced by clone().

1328 : LifeCycleEvent("disperse_evoldisp",""), _fem_cost(-1.0), _mal_cost(-1.0),
1330 {
1333 
1334  LCE_Disperse_base::addParameters("dispersal", updater);
1335 
1336  add_parameter("dispersal_cost",DBL,false,true,0,1, updater);
1337  add_parameter("dispersal_cost_fem",DBL,false,true,0,1, updater);
1338  add_parameter("dispersal_cost_mal",DBL,false,true,0,1, updater);
1339  add_parameter("dispersal_fixed_trait",STR,false,false,0,0, updater);
1340  add_parameter("dispersal_fixed_rate",DBL,false,true,0,1, updater);
1341 }
Implementation of the ParamUpdaterBase interface.
Definition: param.h:348
LifeCycleEvent(const char *name, const char *trait_link)
Cstor.
Definition: lifecycleevent.h:98
void addParameters(string prefix, ParamUpdaterBase *updater)
Definition: LCEdisperse.cc:62
virtual void add_parameter(Param *param)
Interface to add a parameter to the set.
Definition: simcomponent.h:112
Definition: types.h:78
int _fdisp_trait_link
Definition: LCEdisperse.h:188
double _mal_cost
Definition: LCEdisperse.h:175
virtual bool setParameters()
Definition: LCEdisperse.cc:1345
double _fem_cost
Definition: LCEdisperse.h:175
int _mdisp_trait_link
Definition: LCEdisperse.h:188
Definition: types.h:78
virtual LCE_Disperse_EvolDisp::~LCE_Disperse_EvolDisp ( )
inlinevirtual
195 {}

Member Function Documentation

virtual LifeCycleEvent* LCE_Disperse_EvolDisp::clone ( )
inlinevirtual

Implements LifeCycleEvent.

References LCE_Disperse_EvolDisp().

202 {return new LCE_Disperse_EvolDisp();}
LCE_Disperse_EvolDisp()
Definition: LCEdisperse.cc:1327
void LCE_Disperse_EvolDisp::evoldisp ( sex_t  SEX,
int  trait_link,
double  cost 
)
private

References LCE_Disperse_base::_npatch, LifeCycleEvent::_popPtr, Patch::get(), getAimedPatch, Metapop::getPatch(), Individual::getTraitValue(), Metapop::move(), Patch::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().

1487 {
1488 
1489  Patch *current_patch;
1490  unsigned int AimedPatch;
1491 
1492  for(unsigned int i = 0; i < _npatch; i++) {
1493 
1494  current_patch = _popPtr->getPatch(i);
1495 
1496  while( current_patch->size(SEX, OFFSx) != 0 ) {
1497 
1498  if(RAND::Uniform() < *(double*)current_patch->get(SEX, OFFSx, 0)->getTraitValue(trait_link)) {
1499  //this one disperses
1500  AimedPatch = (this->*getAimedPatch)(i);
1501 
1502  current_patch->nbEmigrant++;
1503 
1504  if(RAND::Uniform() > cost) {
1505  //survives
1506  _popPtr->move(SEX, OFFSx, i, PDISPx, AimedPatch, 0);
1507 
1508  _popPtr->getPatch(AimedPatch)->nbImigrant++;
1509  } else {
1510 
1511  _popPtr->recycle( current_patch->get(SEX, OFFSx, 0) );
1512 
1513  current_patch->remove(SEX, OFFSx, 0);
1514  }
1515  } else {
1516  //no dispersal
1517  current_patch->move(SEX,OFFSx,PDISPx,0);
1518  current_patch->nbPhilopat++;
1519  }
1520 
1521  }//end while
1522  }//end for
1523 }
void recycle(Individual *ind)
Put an individual in the recycling pool.
Definition: indfactory.h:62
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:587
void * getTraitValue(IDX T)
Accessor to the value (phenotype) of a particular trait.
Definition: individual.h:271
unsigned int size(age_t AGE)
Returns the size of the container of the appropriate age class(es) for both sexes.
Definition: metapop.h:487
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:564
Second class in the metapopulation design structure, between the Metapop and Individual classes...
Definition: metapop.h:421
Patch * getPatch(unsigned int i)
Patch accessor, return the ith+1 patch in the metapop.
Definition: metapop.h:251
unsigned short nbImigrant
Definition: metapop.h:444
unsigned int _npatch
Definition: LCEdisperse.h:60
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:786
unsigned int(LCE_Disperse_EvolDisp::* getAimedPatch)(unsigned int)
Definition: LCEdisperse.h:176
static double Uniform()
Generates a random number from [0.0, 1.0[ uniformly distributed.
Definition: Uniform.h:101
Definition: types.h:42
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:523
Metapop * _popPtr
The ptr to the current Metapop.
Definition: lifecycleevent.h:81
unsigned short nbPhilopat
Definition: metapop.h:444
unsigned short nbEmigrant
Definition: metapop.h:444
Definition: types.h:42
void LCE_Disperse_EvolDisp::exec_evol2sex ( )
private

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

Referenced by setParameters().

1479 {
1482 }
void evoldisp(sex_t SEX, int trait_link, double cost)
Definition: LCEdisperse.cc:1486
int _fdisp_trait_link
Definition: LCEdisperse.h:188
double _mal_cost
Definition: LCEdisperse.h:175
double _fem_cost
Definition: LCEdisperse.h:175
Definition: types.h:37
int _mdisp_trait_link
Definition: LCEdisperse.h:188
Definition: types.h:37
void LCE_Disperse_EvolDisp::exec_evolfemale ( )
private

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

Referenced by setParameters().

1463 {
1466 }
void evoldisp(sex_t SEX, int trait_link, double cost)
Definition: LCEdisperse.cc:1486
int _fdisp_trait_link
Definition: LCEdisperse.h:188
double _mal_cost
Definition: LCEdisperse.h:175
void fixdisp(sex_t SEX, double rate, double cost)
Definition: LCEdisperse.cc:1527
double _fem_cost
Definition: LCEdisperse.h:175
Definition: types.h:37
double _fixed_disp_rate
Definition: LCEdisperse.h:175
Definition: types.h:37
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().

1471 {
1474 }
void evoldisp(sex_t SEX, int trait_link, double cost)
Definition: LCEdisperse.cc:1486
double _mal_cost
Definition: LCEdisperse.h:175
void fixdisp(sex_t SEX, double rate, double cost)
Definition: LCEdisperse.cc:1527
double _fem_cost
Definition: LCEdisperse.h:175
Definition: types.h:37
int _mdisp_trait_link
Definition: LCEdisperse.h:188
double _fixed_disp_rate
Definition: LCEdisperse.h:175
Definition: types.h:37
void LCE_Disperse_EvolDisp::execute ( )
virtual

Implements LifeCycleEvent.

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

1429 {
1430 #ifdef _DEBUG_
1431  message("LCE_Disperse_EvolDisp::execute (Patch nb: %i offsprg nbr: %i)\n"
1433 #endif
1434  if( getDispersalModel() == 2 ) setPropaguleTargets();
1435 
1436  reset_counters();
1437 
1438  (this->*exec)();
1439 
1440  Patch *current_patch;
1441 
1443 
1444  for(unsigned int i = 0; i < _npatch; i++) {
1445 
1446  current_patch = _popPtr->getPatch(i);
1447 
1448  //set coloniser counter
1449  if(current_patch->get_isExtinct())
1450  current_patch->nbKolonisers = current_patch->size(PDISPx);
1451  else
1452  current_patch->nbKolonisers = -1;
1453 
1454  }//end_for
1455 
1456  swapPostDisp();
1457 
1458 }
unsigned int getDispersalModel()
Definition: LCEdisperse.h:98
void(LCE_Disperse_EvolDisp::* exec)()
Definition: LCEdisperse.h:177
void message(const char *message,...)
Definition: output.cc:40
unsigned int size(age_t AGE)
Returns the size of the container of the appropriate age class(es) for both sexes.
Definition: metapop.h:487
void setPropaguleTargets()
Definition: LCEdisperse.cc:352
void reset_counters()
Definition: LCEdisperse.cc:290
Second class in the metapopulation design structure, between the Metapop and Individual classes...
Definition: metapop.h:421
Patch * getPatch(unsigned int i)
Patch accessor, return the ith+1 patch in the metapop.
Definition: metapop.h:251
unsigned int _npatch
Definition: LCEdisperse.h:60
bool get_isExtinct()
Definition: metapop.h:475
unsigned int getPatchNbr()
Definition: metapop.h:270
void swapPostDisp()
Definition: LCEdisperse.cc:277
#define OFFSPRG
Offspring age class flag.
Definition: types.h:50
unsigned int size()
Get the total number of individuals present in the population, all sex and age classes together...
Definition: metapop.h:302
Metapop * _popPtr
The ptr to the current Metapop.
Definition: lifecycleevent.h:81
short nbKolonisers
Definition: metapop.h:445
Definition: types.h:42
void LCE_Disperse_EvolDisp::fixdisp ( sex_t  SEX,
double  rate,
double  cost 
)
private

References LCE_Disperse_base::_npatch, LifeCycleEvent::_popPtr, Patch::get(), getAimedPatch, Metapop::getPatch(), Metapop::move(), Patch::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().

1528 {
1529 
1530  Patch *current_patch;
1531  unsigned int AimedPatch;
1532 
1533  for(unsigned int i = 0; i < _npatch; i++) {
1534 
1535  current_patch = _popPtr->getPatch(i);
1536 
1537  while( current_patch->size(SEX, OFFSx) != 0 ) {
1538 
1539  if(RAND::Uniform() < rate) {
1540  //this one disperses
1541  AimedPatch = (this->*getAimedPatch)(i);
1542 
1543  current_patch->nbEmigrant++;
1544 
1545  if(RAND::Uniform() > cost) {
1546  //survives
1547  _popPtr->move(SEX, OFFSx, i, PDISPx, AimedPatch, 0);
1548 
1549  _popPtr->getPatch(AimedPatch)->nbImigrant++;
1550  } else {
1551 
1552  _popPtr->recycle( current_patch->get(SEX, OFFSx, 0) );
1553 
1554  current_patch->remove(SEX, OFFSx, 0);
1555  }
1556  } else {
1557  //no dispersal
1558  current_patch->move(SEX,OFFSx,PDISPx,0);
1559  current_patch->nbPhilopat++;
1560  }
1561 
1562  }//end while
1563  }//end for
1564 }
void recycle(Individual *ind)
Put an individual in the recycling pool.
Definition: indfactory.h:62
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: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:487
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:564
Second class in the metapopulation design structure, between the Metapop and Individual classes...
Definition: metapop.h:421
Patch * getPatch(unsigned int i)
Patch accessor, return the ith+1 patch in the metapop.
Definition: metapop.h:251
unsigned short nbImigrant
Definition: metapop.h:444
unsigned int _npatch
Definition: LCEdisperse.h:60
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:786
unsigned int(LCE_Disperse_EvolDisp::* getAimedPatch)(unsigned int)
Definition: LCEdisperse.h:176
static double Uniform()
Generates a random number from [0.0, 1.0[ uniformly distributed.
Definition: Uniform.h:101
Definition: types.h:42
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:523
Metapop * _popPtr
The ptr to the current Metapop.
Definition: lifecycleevent.h:81
unsigned short nbPhilopat
Definition: metapop.h:444
unsigned short nbEmigrant
Definition: metapop.h:444
Definition: types.h:42
unsigned int LCE_Disperse_EvolDisp::Migrate_Island ( unsigned int  home)
private

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

Referenced by setParameters().

1569 {
1570  unsigned int AimedPatch;
1571  //assign a Patch of arrival at random
1572  do{
1573  AimedPatch = RAND::Uniform(_npatch);
1574  }while(AimedPatch == home);
1575 
1576  return AimedPatch;
1577 }
unsigned int _npatch
Definition: LCEdisperse.h:60
static double Uniform()
Generates a random number from [0.0, 1.0[ uniformly distributed.
Definition: Uniform.h:101
unsigned int LCE_Disperse_EvolDisp::Migrate_Island_Propagule ( unsigned int  home)
private

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

Referenced by setParameters().

1582 {
1583  unsigned int AimedPatch, PropaguleTarget = getPropaguleTarget(home);
1584 
1585  if(!(RAND::Uniform() > getPropaguleProb()) )
1586  AimedPatch = PropaguleTarget;
1587  else
1588  do{
1589  AimedPatch = RAND::Uniform(_npatch);
1590  }while(AimedPatch == home || AimedPatch == PropaguleTarget);
1591 
1592  return AimedPatch;
1593 }
unsigned int getPropaguleTarget(unsigned int home)
Definition: LCEdisperse.h:100
unsigned int _npatch
Definition: LCEdisperse.h:60
static double Uniform()
Generates a random number from [0.0, 1.0[ uniformly distributed.
Definition: Uniform.h:101
double getPropaguleProb()
Definition: LCEdisperse.h:99
unsigned int LCE_Disperse_EvolDisp::Migrate_SteppingStone1D ( unsigned int  home)
private

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

Referenced by setParameters().

1598 {
1599  int neighbours[2] = {(int)(home - 1),(int)(home + 1)};
1600  //if we are at one of the bound of the Patch array, we may migrate to the other bound:
1601  if(neighbours[0] < 0) neighbours[0] = _npatch -1;
1602  else if(neighbours[1] == (int)_npatch) neighbours[1] = 0;
1603 
1604  return(RAND::RandBool() ? neighbours[0] : neighbours[1]);
1605 }
unsigned int _npatch
Definition: LCEdisperse.h:60
static bool RandBool()
Returns a random boolean.
Definition: Uniform.h:139
bool LCE_Disperse_EvolDisp::setParameters ( )
virtual

Implements SimComponent.

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, error(), exec, exec_evol2sex(), exec_evolfemale(), exec_evolmale(), getAimedPatch, ParamSet::getArg(), LCE_Disperse_base::getDispersalModel(), Metapop::getPatchNbr(), IndFactory::getTraitIndex(), ParamSet::getValue(), ParamSet::isSet(), Migrate_Island(), Migrate_Island_Propagule(), and Migrate_SteppingStone1D().

Referenced by LCE_Disperse_EvolDisp().

1346 {
1347  //we do not call the LCE_Disperse_base::setParameters here because we don't use
1348  //dispersal matrices in input
1350 
1351  _prefix = "dispersal";
1352 
1353  _disp_model = (int)_paramSet->getValue("dispersal_model");
1354 
1355  _disp_propagule_prob = _paramSet->getValue("dispersal_propagule_prob");
1356 
1357  if(_disp_model == -1) {
1358  error("dispersal model not specified!\n");
1359  return false;
1360  }
1361 
1362  if(_disp_model == 2 && _disp_propagule_prob == -1) {
1363  error("dispersal propagule probability is missing!\n");
1364  return false;
1365  }
1366 
1369 
1370  if(_paramSet->isSet("dispersal_cost")) {
1371 
1372  _fem_cost = _mal_cost = _paramSet->getValue("dispersal_cost");
1373 
1374  } else if(_paramSet->isSet("dispersal_cost_fem") && _paramSet->isSet("dispersal_cost_mal")) {
1375 
1376  _fem_cost = _paramSet->getValue("dispersal_cost_fem");
1377 
1378  _mal_cost = _paramSet->getValue("dispersal_cost_mal");
1379 
1380  } else {
1381  error("dispersal cost params are not set !\n");
1382  return false;
1383  }
1384 
1385  if(_paramSet->isSet("dispersal_fixed_trait")) {
1386 
1387  if(_paramSet->getArg("dispersal_fixed_trait").compare("female") == 0) {
1388 
1390 
1391  } else if(_paramSet->getArg("dispersal_fixed_trait").compare("male") == 0) {
1392 
1394 
1395  } else {
1396  error("wrong argument value for \"dispersal_fixed_trait\"\n");
1397  return false;
1398  }
1399 
1400  _fixed_disp_rate = _paramSet->getValue("dispersal_fixed_rate");
1401 
1402  } else
1404 
1405  switch ( getDispersalModel() ) {
1406  case 0:
1407  case 1:
1409  break;
1410  case 2:
1412  break;
1413  case 3:
1415  break;
1416  default: {
1418  error("\nDispersal model %i not yet implemented with evolving dispersal!\n",
1419  getDispersalModel());
1420  return false;
1421  }
1422  }
1423  return true;
1424 }
unsigned int getDispersalModel()
Definition: LCEdisperse.h:98
void(LCE_Disperse_EvolDisp::* exec)()
Definition: LCEdisperse.h:177
unsigned int Migrate_Island(unsigned int home)
Definition: LCEdisperse.cc:1568
int _disp_model
Definition: LCEdisperse.h:42
void exec_evol2sex()
Definition: LCEdisperse.cc:1478
unsigned int _npatch
Definition: LCEdisperse.h:60
unsigned int getPatchNbr()
Definition: metapop.h:270
int error(const char *str,...)
Definition: output.cc:73
void exec_evolmale()
Definition: LCEdisperse.cc:1470
int _fdisp_trait_link
Definition: LCEdisperse.h:188
void exec_evolfemale()
Definition: LCEdisperse.cc:1462
unsigned int(LCE_Disperse_EvolDisp::* getAimedPatch)(unsigned int)
Definition: LCEdisperse.h:176
double _mal_cost
Definition: LCEdisperse.h:175
double _fem_cost
Definition: LCEdisperse.h:175
unsigned int Migrate_Island_Propagule(unsigned int home)
Definition: LCEdisperse.cc:1581
int getTraitIndex(trait_t type)
Gives the index of trait with type.
Definition: indfactory.cc:128
ParamSet * _paramSet
The parameters container.
Definition: simcomponent.h:48
double getValue(string name)
Accessor the parameters value.
Definition: param.h:287
int _mdisp_trait_link
Definition: LCEdisperse.h:188
string getArg(string name)
Accessor to the parameters argument string.
Definition: param.h:285
bool isSet()
Accessor to the status flag.
Definition: param.h:273
Metapop * _popPtr
The ptr to the current Metapop.
Definition: lifecycleevent.h:81
double _fixed_disp_rate
Definition: LCEdisperse.h:175
double _disp_propagule_prob
Definition: LCEdisperse.h:43
unsigned int Migrate_SteppingStone1D(unsigned int home)
Definition: LCEdisperse.cc:1597
string _prefix
Definition: LCEdisperse.h:54

Member Data Documentation

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

Referenced by execute(), and setParameters().

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