Simulating Mating Alliances as a Reproductive Tactic for Populations
 All Classes Functions Variables Friends
human.h
1 #ifndef DEF_HUMAN
2 #define DEF_HUMAN
3 #include <string>
4 #include <string.h> // need this one for memcpy
5 #include <iostream>
6 #include <stdlib.h>
7 #include <cstdlib>
8 #include <cmath>
9 #include <vector>
10 #include <stdio.h>
11 #include "utils.h"
12 #define SIZE_MTDNA 3200 // default values
13 #define NB_CHROMOSOME 2
14 #define SIZE_CHROMOSOME 3200
15 #define TRACK_MATE_AND_CHILDREN 0 // change to 1 if want to actually compute nb of mate and children otherwise waste of time
16 
17 static const int NB_CHROMOSOME_CELL = SIZE_CHROMOSOME/CRUMB; // Number of case per chromosome
18 static const int NB_MTDNA_CELL = SIZE_MTDNA/CRUMB;
19 
20 class Human
21 {
22  public:
23  Human(); //
24  Human(int,int); // Constructor with size of MTDNA as first number
25  Human(int pIdMother,int pIdFather,int,int);
26  Human(Human const &);// copy constructor
27  ~Human();
28  friend std::ostream &operator<<(std::ostream&, Human const&);
29  Human& operator = (Human const&);
30  bool shared_parents(Human const &);
31  bool shared_parents2(Human const &);
32  void reborn(int newMother, int newFather);
33  void reborn(Human const &);
34  void reset();
35  int getMother() const;
36  int getFather() const;
37  int getNbMate() const;
38  int getNbChild() const;
39  void hadChild(int n);
40  void newMate();
42  protected:
43  int idFather;
44  int idMother;
45  int nbChild;
46  int nbMate;
48  private:
49  std::ostream& print(std::ostream&) const;
50 };
51 #endif
void hadChild(int n)
Definition: human.cpp:135
Human & operator=(Human const &)
Definition: human.cpp:46
int idFather
Definition: human.h:43
int getNbChild() const
Definition: human.cpp:130
int nbChild
Definition: human.h:45
int idMother
Definition: human.h:44
int nbMate
Definition: human.h:46
Definition: human.h:20
void reset()
Definition: human.cpp:107
void reborn(int newMother, int newFather)
Definition: human.cpp:91
int getNbMate() const
Definition: human.cpp:125
int getFather() const
Definition: human.cpp:120
void newMate()
Definition: human.cpp:140

Home