|
| LCE_Init_BDMI () |
|
virtual | ~LCE_Init_BDMI () |
|
bool | setSpatialPattern (TMatrix &freq_mat, unsigned int patchNbr) |
|
bool | setPatchFreq (TMatrix &freq_mat, TMatrix &pat_mat, unsigned int patchNbr) |
|
void | init_value (sex_t SEX, age_idx age, unsigned int size, unsigned int deme) |
|
virtual void | execute () |
|
virtual LifeCycleEvent * | clone () |
|
virtual bool | setParameters () |
|
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 () |
|
| 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 Metapop * | get_pop_ptr () |
|
| 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 ParamSet * | get_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 Param * | get_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...
|
|
Allelic frequency initialiser for the DBMI trait.
It executes at the first generation of each replicate only.
void LCE_Init_BDMI::execute |
( |
| ) |
|
|
virtual |
Implements LifeCycleEvent.
1028{
1029
1031
1033 double *values =
new double[
_nLocus];
1035
1036 for (unsigned int i = 0; i < patchNbr ; i++) {
1037
1039
1041
1046
1047 }
1048
1049 delete [] values;
1050}
TraitPrototype * getTraitPrototype(trait_t type)
Accessor to a TraitPrototype.
Definition: indfactory.cc:140
TMatrix _init_freq
Definition: ttbdmi.h:301
unsigned int _nLocus
Definition: ttbdmi.h:302
void init_value(sex_t SEX, age_idx age, unsigned int size, unsigned int deme)
Definition: ttbdmi.cc:1054
Metapop * _popPtr
The ptr to the current Metapop.
Definition: lifecycleevent.h:81
void getRowView(unsigned int row, unsigned int n, double *array)
Gives access to a row of the matrix.
Definition: tmatrix.h:196
void set_init_freq(double *val, unsigned int size)
Definition: ttbdmi.cc:197
@ FEM
Definition: types.h:37
@ MAL
Definition: types.h:37
#define ADULTS
Adults age class flag (breeders).
Definition: types.h:54
#define OFFSPRG
Offspring age class flag.
Definition: types.h:50
@ OFFSx
Definition: types.h:42
@ ADLTx
Definition: types.h:42
References _init_freq, _nLocus, LifeCycleEvent::_popPtr, ADLTx, ADULTS, FEM, Metapop::getCurrentGeneration(), Metapop::getPatchNbr(), TMatrix::getRowView(), IndFactory::getTraitPrototype(), init_value(), MAL, OFFSPRG, OFFSx, TProtoBDMI::set_init_freq(), and Metapop::size().
bool LCE_Init_BDMI::setParameters |
( |
| ) |
|
|
virtual |
Implements SimComponent.
911{
915 bool isPatchSpecific = false;
916
918
920
923 isPatchSpecific = true;
924 }
925
926 unsigned int ncol = freq_mat.
getNbCols();
927 unsigned int npat = freq_mat.
getNbRows();
928
929
930
931
932 if(npat > patchNbr) {
933 error(
"The number of rows in \"dmi_init_freq\" is greater than the number of patches, must be at least equal to it.");
934 return false;
935 }
937 error(
"The number of columns in \"dmi_init_freq\" is greater than number of loci, must be at least equal to it.\n");
938 return false;
939 }
940
942
943 bool status;
944 if ( isPatchSpecific )
946 else
948
949 return status;
950}
bool setSpatialPattern(TMatrix &freq_mat, unsigned int patchNbr)
Definition: ttbdmi.cc:955
bool setPatchFreq(TMatrix &freq_mat, TMatrix &pat_mat, unsigned int patchNbr)
Definition: ttbdmi.cc:993
void getMatrix(string name, TMatrix *mat)
Accessor to the parameters matrix.
Definition: param.h:304
bool isSet()
Definition: param.h:140
virtual Param * get_parameter(std::string name)
Param getter.
Definition: simcomponent.h:139
ParamSet * _paramSet
The parameters container.
Definition: simcomponent.h:48
A class to handle matrix in params, coerces matrix into a vector of same total size.
Definition: tmatrix.h:49
void reset(unsigned int rows, unsigned int cols)
Re-allocate the existing matrix with assigned rows and cols dimensions.
Definition: tmatrix.h:116
unsigned int getNbRows()
Gives the number of rows.
Definition: tmatrix.h:166
unsigned int getNbCols()
Gives the number of columns.
Definition: tmatrix.h:169
int get_nb_locus()
Definition: ttbdmi.h:77
int error(const char *str,...)
Definition: output.cc:77
References _init_freq, _nLocus, SimComponent::_paramSet, LifeCycleEvent::_popPtr, error(), TProtoBDMI::get_nb_locus(), SimComponent::get_parameter(), ParamSet::getMatrix(), TMatrix::getNbCols(), TMatrix::getNbRows(), Metapop::getPatchNbr(), IndFactory::getTraitPrototype(), Param::isSet(), TMatrix::reset(), setPatchFreq(), and setSpatialPattern().