-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpopulationsimulation.h
53 lines (49 loc) · 1.2 KB
/
populationsimulation.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#ifndef POPULATIONSIMULATION_H
#define POPULATIONSIMULATION_H
#include <vector>
/**
* @brief Lance la simulation en suivant le modèle population-centré.
*
*/
struct Typemolecule_struct {
int id;
char* name;
float speed;
int size;
};
struct Reaction_struct {
int id;
int r1;
int r2;
int p1;
int p2;
float p;
};
class PopulationSimulation {
private:
float diameter;
std::vector<Reaction_struct*> reaction_list;
std::vector<Typemolecule_struct*> typemolecule_list;
int* molecule_list;
int length_molecule_list;
/* Find id */
int findTypeID(char*) const;
/* Print simulation state */
void print(int) const;
/* Print reactions in simulation */
void printReactions(void) const;
public:
PopulationSimulation();
/* Set simulation diameter (used by parser) */
void setDiameter(int);
/* Add reaction/molecule/type of molecule to simulation (used by parser) */
void addReaction(char*, char*, char*, char*, float);
void addMolecule(char*, int);
void addTypeMolecule(char*);
/* Set molecule type parameters (used by parser) */
void setTypeMoleculeSpeed(char*, float);
void setTypeMoleculeSize(char*, int);
/* Run the simulation for t ticks */
void run(int);
};
#endif