Egglib 2.1.11
C++ library reference manual
Controller.hpp
1 /*
2  Copyright 2009-2010 Stéphane De Mita, Mathieu Siol
3 
4  This file is part of the EggLib library.
5 
6  EggLib is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  EggLib is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with EggLib. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #ifndef EGGLIB_CONTROLLER_HPP
21 #define EGGLIB_CONTROLLER_HPP
22 
23 #include "Current.hpp"
24 #include "Arg.hpp"
25 #include "ParamSet.hpp"
26 
27 namespace egglib {
28 
29  class Random;
30 
39  class Controller {
40 
41  public:
42 
49  Controller();
50 
54  ~Controller();
55 
65  Controller(const ParamSet* paramSet, Random* random);
66 
72  void reset();
73 
79  unsigned int step();
80 
86  Arg* getArg();
87 
104  void bottleneck(unsigned int populationIndex, double strength);
105 
112  void moveAllLineages(unsigned int source, unsigned int dest);
113 
125  void moveSomeLineages(unsigned int source, unsigned int dest, double probability);
126 
128  void addPopulation();
129 
130  private:
131 
133  Controller(const Controller& source) {}
134 
136  Controller& operator=(const Controller& source) {return *this;}
137 
138  void diploids();
139  double getMigrationTime(double& migrationParameterDestination);
140  void getCoalescenceTime(double& destTime, unsigned int& destPopIndex);
141  double getCoalescenceTimeForPopulation(unsigned int populationIndex);
142  double getRecombinationTime() const;
143  void migrate(double migrationParameter);
144 
145  const ParamSet* initialParamSet;
146  ParamSet paramSet;
147  Current current;
148  Arg arg;
149 
150  Random* random;
151 
152  };
153 
154 }
155 
156 #endif
Pseudo-random number generator.
Definition: Random.hpp:41
void moveSomeLineages(unsigned int source, unsigned int dest, double probability)
Migrate a complete population.
Definition: Controller.cpp:219
Controller()
Default constructor.
Definition: Controller.cpp:31
void bottleneck(unsigned int populationIndex, double strength)
Applies a bottleneck to a given population.
Definition: Controller.cpp:194
Represents the current set of populations.
Definition: Current.hpp:34
void moveAllLineages(unsigned int source, unsigned int dest)
Migrate a complete population.
Definition: Controller.cpp:209
unsigned int step()
Increments the coalescent model.
Definition: Controller.cpp:84
~Controller()
Destructor.
Definition: Controller.cpp:40
void reset()
Reset for a new simulation.
Definition: Controller.cpp:58
Controls a coalescent simulation.
Definition: Controller.hpp:39
Arg * getArg()
Gets the Ancestral Recombination Graph.
Definition: Controller.cpp:187
void addPopulation()
Adds an empty population.
Definition: Controller.cpp:233
Definition: ABC.cpp:37
Set of parameters.
Definition: ParamSet.hpp:38
Ancestral recombination graph.
Definition: Arg.hpp:60

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