Modular Megafauna Model 1.1.5
A physiological, dynamic herbivore simulator in C++.
Loading...
Searching...
No Matches
breeding_season.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2020 W. Traylor <wolfgang.traylor@senckenberg.de>
2//
3// SPDX-License-Identifier: LGPL-3.0-or-later
4
11#ifndef FAUNA_BREEDING_SEASON_H
12#define FAUNA_BREEDING_SEASON_H
13
14namespace Fauna {
15
18 public:
20
26 BreedingSeason(const int breeding_season_start,
27 const int breeding_season_length);
28
30
33 bool is_in_season(const int day) const;
34
36 double annual_to_daily_rate(const double annual) const;
37
39 bool operator==(const BreedingSeason& other) const {
40 return start == other.start && length == other.length;
41 }
42
43 private:
44 int start; // day of year (0=Jan 1st)
45 int length; // number of days
46};
47
48} // namespace Fauna
49
50#endif // FAUNA_BREEDING_SEASON_H
Helper class for reproduction within a breeding season.
Definition: breeding_season.h:17
bool is_in_season(const int day) const
Whether given day (0=Jan 1st) is in the breeding season.
Definition: breeding_season.cpp:30
bool operator==(const BreedingSeason &other) const
Whether all member variables are the same in the other object.
Definition: breeding_season.h:39
int length
Definition: breeding_season.h:45
double annual_to_daily_rate(const double annual) const
Convert an annual reproduction rate to a daily one in season.
Definition: breeding_season.cpp:45
int start
Definition: breeding_season.h:44
Definition: average.h:16