Goose Management Model ODdox  1.02
GooseBarnacle_All.h
Go to the documentation of this file.
1 /*
2 *******************************************************************************************************
3 Copyright (c) 2013, Christopher John Topping, University of Aarhus
4 All rights reserved.
5 
6 Redistribution and use in source and binary forms, with or without modification, are permitted provided
7 that the following conditions are met:
8 
9 Redistributions of source code must retain the above copyright notice, this list of conditions and the
10 following disclaimer.
11 Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
12 the following disclaimer in the documentation and/or other materials provided with the distribution.
13 
14 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
15 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16 FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
17 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
18 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
19 BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
21 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 ********************************************************************************************************
23 */
24 #ifndef Goose_Barnacle_Base_BaseH
25 #define Goose_Barnacle_Base_BaseH
26 
37 //---------------------------------------------------------------------------
38 
39 class Goose_Base;
40 class Landscape;
42 
47 {
48 public:
50  Goose_Barnacle_Base(Landscape* p_L, Goose_Population_Manager* p_NPM, double a_weight, bool a_sex, APoint a_roost);
52  void Init(Goose_Population_Manager* p_NPM, double a_weight, bool a_sex, APoint a_roost);
54  void ReInit(Landscape* p_L, Goose_Population_Manager* p_NPM, double a_weight, bool a_sex, APoint a_roost);
56  virtual ~Goose_Barnacle_Base();
57 protected:
65  virtual void ChangeRoost() { m_OurPopulationManager->FindClosestRoost(m_Location_x, m_Location_y, (unsigned) gs_Barnacle); }
69  virtual APoint ChooseHopLoc();
70 };
71 
76 {
77 public:
79  Goose_Barnacle_FamilyGroup(Landscape* p_L, Goose_Population_Manager* p_NPM, double a_weight, bool a_sex, int a_groupsize, APoint a_roost);
81  void Init(Goose_Population_Manager* p_NPM, double a_weight, bool a_sex, int a_groupsize, APoint a_roost);
83  void ReInit(Landscape* p_L, Goose_Population_Manager* p_NPM, double a_weight, bool a_sex, int a_groupsize, APoint a_roost);
87  virtual void Step( void );
89  virtual void EndStep(void) { ; }
91  virtual void KillThis(void);
92 };
93 
98 {
99 public:
101  Goose_Barnacle_NonBreeder(Landscape* p_L, Goose_Population_Manager* p_NPM, double a_weight, bool a_sex, APoint a_roost);
103  void Init(Goose_Population_Manager* p_NPM, double a_weight, bool a_sex, APoint a_roost);
105  void ReInit(Landscape* p_L, Goose_Population_Manager* p_NPM, double a_weight, bool a_sex, APoint a_roost);
107  virtual ~Goose_Barnacle_NonBreeder();
109  virtual void Step( void );
110 };
111 #endif
Goose_Barnacle_FamilyGroup::Goose_Barnacle_FamilyGroup
Goose_Barnacle_FamilyGroup(Landscape *p_L, Goose_Population_Manager *p_NPM, double a_weight, bool a_sex, int a_groupsize, APoint a_roost)
Goose_Barnacle_FamilyGroup constructor.
Definition: GooseBarnacle_All.cpp:148
Goose_Barnacle_FamilyGroup::~Goose_Barnacle_FamilyGroup
virtual ~Goose_Barnacle_FamilyGroup()
Goose_Barnacle_FamilyGroup destructor.
Definition: GooseBarnacle_All.cpp:170
Goose_Barnacle_FamilyGroup::Init
void Init(Goose_Population_Manager *p_NPM, double a_weight, bool a_sex, int a_groupsize, APoint a_roost)
Intitialise object.
Definition: GooseBarnacle_All.cpp:154
Goose_Barnacle_FamilyGroup
A class to describe the Barnacle family group.
Definition: GooseBarnacle_All.h:75
Goose_Barnacle_NonBreeder::Init
void Init(Goose_Population_Manager *p_NPM, double a_weight, bool a_sex, APoint a_roost)
Intitialise object.
Definition: GooseBarnacle_All.cpp:223
Goose_Barnacle_FamilyGroup::Step
virtual void Step(void)
The Goose_Barnacle_FamilyGroup Step.
Definition: GooseBarnacle_All.cpp:176
Goose_Barnacle_FamilyGroup::KillThis
virtual void KillThis(void)
The FamilyGroup KillThis must be overridden for families.
Definition: GooseBarnacle_All.cpp:283
Goose_Barnacle_Base::ChooseHopLoc
virtual APoint ChooseHopLoc()
Pick a hop location point within a_dist meters - must be overridden by descendent classes.
Definition: GooseBarnacle_All.cpp:121
Goose_Barnacle_Base::st_ToRoost
TTypeOfGoose_BaseState st_ToRoost()
Return to roost and assess whether to forage again that day.
Definition: GooseBarnacle_All.cpp:98
Landscape
The landscape class containing all environmental and topographical data.
Definition: landscape.h:112
Goose_Barnacle_FamilyGroup::ReInit
void ReInit(Landscape *p_L, Goose_Population_Manager *p_NPM, double a_weight, bool a_sex, int a_groupsize, APoint a_roost)
ReInit for object pool.
Definition: GooseBarnacle_All.cpp:165
Goose_Population_Manager::FindClosestRoost
void FindClosestRoost(int &a_x, int &a_y, unsigned a_type)
Changes a_x & a_y to the location of the nearest roost of a_type to a_x, a_y.
Definition: Goose_Population_Manager.cpp:1000
Goose_Barnacle_Base::Goose_Barnacle_Base
Goose_Barnacle_Base(Landscape *p_L, Goose_Population_Manager *p_NPM, double a_weight, bool a_sex, APoint a_roost)
Goose_Barnacle_Base constructor.
Definition: GooseBarnacle_All.cpp:68
Goose_Barnacle_NonBreeder::~Goose_Barnacle_NonBreeder
virtual ~Goose_Barnacle_NonBreeder()
Goose_Barnacle_NonBreeder destructor.
Definition: GooseBarnacle_All.cpp:238
Goose_Barnacle_NonBreeder::Goose_Barnacle_NonBreeder
Goose_Barnacle_NonBreeder(Landscape *p_L, Goose_Population_Manager *p_NPM, double a_weight, bool a_sex, APoint a_roost)
Goose_Barnacle_NonBreeder constructor.
Definition: GooseBarnacle_All.cpp:218
Goose_Barnacle_FamilyGroup::EndStep
virtual void EndStep(void)
The Goose_Barnacle_FamilyGroup EndStep.
Definition: GooseBarnacle_All.h:89
Goose_Barnacle_Base::~Goose_Barnacle_Base
virtual ~Goose_Barnacle_Base()
Goose_Barnacle_Base destructor.
Definition: GooseBarnacle_All.cpp:92
Goose_Barnacle_NonBreeder::Step
virtual void Step(void)
The Goose_Barnacle_NonBreeder Step.
Definition: GooseBarnacle_All.cpp:244
Goose_Population_Manager
The class to handle all goose population related matters.
Definition: Goose_Population_Manager.h:392
Goose_Barnacle_NonBreeder
A class to describe the Barnacle non-breeder.
Definition: GooseBarnacle_All.h:97
Goose_Base
A class to describe the goose base.
Definition: Goose_Base.h:131
Goose_Base::m_OurPopulationManager
Goose_Population_Manager * m_OurPopulationManager
This is a time saving pointer to the correct population manager object.
Definition: Goose_Base.h:151
TTypeOfGoose_BaseState
TTypeOfGoose_BaseState
Definition: Goose_Base.h:74
Goose_Barnacle_Base::Init
void Init(Goose_Population_Manager *p_NPM, double a_weight, bool a_sex, APoint a_roost)
Intitialise object.
Definition: GooseBarnacle_All.cpp:72
Goose_Barnacle_Base::ReInit
void ReInit(Landscape *p_L, Goose_Population_Manager *p_NPM, double a_weight, bool a_sex, APoint a_roost)
ReInit for object pool.
Definition: GooseBarnacle_All.cpp:86
Goose_Barnacle_Base
A class to describe the Barnacle goose base.
Definition: GooseBarnacle_All.h:46
Goose_Barnacle_Base::ChangeRoost
virtual void ChangeRoost()
Find the closest roost.
Definition: GooseBarnacle_All.h:65
Goose_Barnacle_NonBreeder::ReInit
void ReInit(Landscape *p_L, Goose_Population_Manager *p_NPM, double a_weight, bool a_sex, APoint a_roost)
ReInit for object pool.
Definition: GooseBarnacle_All.cpp:232