1 /*
2  *  cBirthEntry.h
3  *  Avida
4  *
5  *  Created by David Bryson on 4/1/09.
6  *  Copyright 2009-2011 Michigan State University. All rights reserved.
7  *
8  *
9  *  This file is part of Avida.
10  *
11  *  Avida is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License
12  *  as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
13  *
14  *  Avida is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
15  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
16  *
17  *  You should have received a copy of the GNU Lesser General Public License along with Avida.
18  *  If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef cBirthEntry_h
23 #define cBirthEntry_h
24 
25 #include "avida/core/Genome.h"
26 
27 #ifndef cMerit_h
28 #include "cMerit.h"
29 #endif
30 
31 class cBioGroup;
32 class cOrganism;
33 
34 using namespace Avida;
35 
36 
37 class cBirthEntry
38 {
39 private:
40   int m_mating_type;
41   int m_mating_display_a;
42   int m_mating_display_b;
43   int m_mate_preference;
44   int m_group_id;
45   tArray<int> m_parent_task_count;
46 public:
47   Genome genome;
48   double energy4Offspring;
49   cMerit merit;
50   int timestamp; // -1 if empty
51   tArray<cBioGroup*> groups;
52 
53   cBirthEntry();
54   cBirthEntry(const Genome& _offspring, cOrganism* _parent, int _timestamp);
55 
56   //Accessor functions
GetMatingType()57   int GetMatingType() { return m_mating_type; }
GetParentTaskCount(int which_task)58   int GetParentTaskCount(int which_task) { return m_parent_task_count[which_task]; }
GetParentTaskCount()59   const tArray<int>& GetParentTaskCount() const { return m_parent_task_count; }
GetMatingDisplayA()60   int GetMatingDisplayA() const { return m_mating_display_a; }
GetMatingDisplayB()61   int GetMatingDisplayB() const { return m_mating_display_b; }
GetMatePreference()62   int GetMatePreference() const { return m_mate_preference; }
GetGroupID()63   int GetGroupID() const { return m_group_id; }
64 
SetMatingType(int _mating_type)65   void SetMatingType(int _mating_type) { m_mating_type = _mating_type; } //@CHC
SetParentTaskCount(tArray<int> _parent_task_count)66   void SetParentTaskCount(tArray<int> _parent_task_count) { m_parent_task_count = _parent_task_count; } //@CHC
SetMatingDisplayA(int _mating_display_a)67   void SetMatingDisplayA(int _mating_display_a) { m_mating_display_a = _mating_display_a; } //@CHC
SetMatingDisplayB(int _mating_display_b)68   void SetMatingDisplayB(int _mating_display_b) { m_mating_display_b = _mating_display_b; } //@CHC
SetMatePreference(int _mate_preference)69   void SetMatePreference(int _mate_preference) { m_mate_preference = _mate_preference; }
SetGroupID(int _group_id)70   void SetGroupID(int _group_id) { m_group_id = _group_id; }
71 
72   //Other functions
73   cString GetPhenotypeString();
74   static cString GetPhenotypeStringFormat();
75 
76   //Operators
77   cBirthEntry& operator=(const cBirthEntry& _birth_entry);
78 
79 };
80 
81 #endif
82