Egglib 2.1.11
C++ library reference manual
Public Member Functions | List of all members
ParamSet Class Reference

Set of parameters. More...

#include <ParamSet.hpp>

Public Member Functions

 ParamSet ()
 Default constructor. More...
 
 ~ParamSet ()
 Destructor. More...
 
 ParamSet (const ParamSet &)
 Copy constructor. More...
 
ParamSetoperator= (const ParamSet &)
 Assignment operator. More...
 
void reset ()
 Restores default value of all parameters. More...
 
unsigned int numberOfPopulations () const
 Gets the number of populations. More...
 
double pairwiseMigrationRate (unsigned int source, unsigned int dest) const
 Gets a pairwise migration rate. More...
 
void pairwiseMigrationRate (unsigned int source, unsigned int dest, double value)
 Sets a pairwise migration rate. More...
 
void migrationRate (double value)
 Sets the migration rate for all matrix. More...
 
double populationSize (unsigned int populationIndex) const
 Gets a population size. More...
 
void populationSize (unsigned int populationIndex, double value)
 Sets a population size. More...
 
double growthRate (unsigned int populationIndex) const
 Gets a growth rate. More...
 
void growthRate (unsigned int populationIndex, double value)
 Sets a growth rate. More...
 
double recombinationRate () const
 Gets the recombination rate. More...
 
void recombinationRate (double value)
 Sets the recombination rate. More...
 
unsigned int numberOfSegments () const
 Gets the number of recombining segments. More...
 
void numberOfSegments (unsigned int value)
 Sets the number of recombining segments. More...
 
double selfingRate () const
 Gets the selfing rate. More...
 
void selfingRate (double value)
 Sets the selfing rate. More...
 
void addPopulation (double migr)
 Adds a population to the model. More...
 
void addChange (const Change *change)
 Adds a change. More...
 
double nextChangeDate () const
 Gets the date of the next change. More...
 
void nextChangeDo (Controller *controller)
 Applies the next change event. More...
 
unsigned int singles (unsigned int populationIndex) const
 Gets the number of single sample from a population. More...
 
void singles (unsigned int populationIndex, unsigned int value)
 Sets the number of single sample from a population. More...
 
unsigned int doubles (unsigned int populationIndex) const
 Gets the number of double sample from a population. More...
 
void doubles (unsigned int populationIndex, unsigned int value)
 Sets the number of double sample from a population. More...
 
unsigned int numberOfSamples () const
 Computes the total number of samples. More...
 
double dateOfLastChange (unsigned int populationIndex) const
 Gives the date of the last size change. More...
 
void dateOfLastChange (unsigned int populationIndex, double date) const
 Sets the date of the last size change. More...
 
void setGroups (DataMatrix &dataMatrix, bool labelIndividuals=false)
 Set groups labels. More...
 

Detailed Description

Set of parameters.

Constructor & Destructor Documentation

ParamSet ( )

Default constructor.

Initializes all parameters to reasonnable values (except that the sample size is null: 1 population, 0 samples, selfing rate of 0, recombination rate of 0, growth rate of 0, population size of 1 and no changes.

~ParamSet ( )

Destructor.

ParamSet ( const ParamSet source)

Copy constructor.

Member Function Documentation

void addChange ( const Change change)

Adds a change.

The change can be of any type derived from Change. A const Change* must be passed, so ParamSet will neither modify or delete the object itself. All passed Change object must be kept available for use by ParamSet.

void addPopulation ( double  migr)

Adds a population to the model.

Parameters
migrpairwise migration rate between other population and the new one.

The parameters for the new population are equivalent to the default parameters.

double dateOfLastChange ( unsigned int  populationIndex) const

Gives the date of the last size change.

Parameters
populationIndexthe index of the population.
Returns
The date where the last change occurred, or 0. if no change occurred during the simulation.
void dateOfLastChange ( unsigned int  populationIndex,
double  date 
) const

Sets the date of the last size change.

Parameters
populationIndexthe index of the population.
datethe date where the last change occurred, or 0. if no change occurred during the simulation.
unsigned int doubles ( unsigned int  populationIndex) const

Gets the number of double sample from a population.

void doubles ( unsigned int  populationIndex,
unsigned int  value 
)

Sets the number of double sample from a population.

double growthRate ( unsigned int  populationIndex) const

Gets a growth rate.

void growthRate ( unsigned int  populationIndex,
double  value 
)

Sets a growth rate.

void migrationRate ( double  value)

Sets the migration rate for all matrix.

double nextChangeDate ( ) const

Gets the date of the next change.

Returns -1 if no change is planned.

void nextChangeDo ( Controller controller)

Applies the next change event.

Parameters
controllerthe Change event might need to have access to simulation controller (to trigger coalescent events, for example).
unsigned int numberOfPopulations ( ) const

Gets the number of populations.

unsigned int numberOfSamples ( ) const

Computes the total number of samples.

unsigned int numberOfSegments ( ) const

Gets the number of recombining segments.

void numberOfSegments ( unsigned int  value)

Sets the number of recombining segments.

ParamSet & operator= ( const ParamSet source)

Assignment operator.

double pairwiseMigrationRate ( unsigned int  source,
unsigned int  dest 
) const

Gets a pairwise migration rate.

It is allowed to access a diagonal value. Diagonal values contain the sum of values of the corresponding line (diagonal cell excepted, of course).

void pairwiseMigrationRate ( unsigned int  source,
unsigned int  dest,
double  value 
)

Sets a pairwise migration rate.

It is not allowed to set a value on the diagonal (this would raise an exception). The method takes care of modifying the diagonal accordingly (still this is not relevant for the client);

double populationSize ( unsigned int  populationIndex) const

Gets a population size.

void populationSize ( unsigned int  populationIndex,
double  value 
)

Sets a population size.

The size must be strictly positive.

double recombinationRate ( ) const

Gets the recombination rate.

void recombinationRate ( double  value)

Sets the recombination rate.

void reset ( )

Restores default value of all parameters.

double selfingRate ( ) const

Gets the selfing rate.

void selfingRate ( double  value)

Sets the selfing rate.

void setGroups ( DataMatrix dataMatrix,
bool  labelIndividuals = false 
)

Set groups labels.

Sets the group labels of the DataMatrix, according to the current state of population structure, and assuming that the DataMatrix was generated by the class Arg.

Parameters
dataMatrixthe DataMatrix object to modify. The number of sequences must match the total number of samples defined by the ParamSet object this method is called on.
labelIndividualsby default, labels the different samples depending on the population they come from (0 being the label of the first population). If this flag is set to true, then the samples are labelled depending on the individual they come from, regardless of populations. In that case there can be only one or two genes for a given group label.
unsigned int singles ( unsigned int  populationIndex) const

Gets the number of single sample from a population.

void singles ( unsigned int  populationIndex,
unsigned int  value 
)

Sets the number of single sample from a population.


The documentation for this class was generated from the following files:

Hosted by 
Get EggLib at SourceForge.net. Fast, secure and Free Open Source software downloads