-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTsetseFlyCore.mpp
More file actions
109 lines (85 loc) · 2.75 KB
/
TsetseFlyCore.mpp
File metadata and controls
109 lines (85 loc) · 2.75 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
//LABEL(TsetseFlyCore, EN) Core functionality of the TsetseFly actor
/* NOTE(TsetseFlyCore, EN)
This module contains the basic information which defines the TsetseFly actor.
*/
parameters
{
int StartingPopulationSize; //EN Starting population size
double PropFemale; //EN Proportion of females
};
classification LIFESTAGE
{
PUPA,
MALE,
FEMALE
};
actor_set TsetseFly asAllTsetseFly; //EN All TsetseFly actors
actor TsetseFly //EN Individual
{
int integer_age = self_scheduling_int(age);
AGE days_lived = COERCE(AGE,integer_age);
int integer_time = self_scheduling_int(time);
DAY_NUMBER day_number = COERCE(DAY_NUMBER, integer_time);
// The states time and age are automatically defined by Modgen.
// Model-specific labels and notes are supplied below.
//LABEL(TsetseFly.time, EN) Time
/*NOTE(TsetseFly.time, EN)
Time is a continuous quantity in this model.
A unit of time is a year.
*/
//LABEL(TsetseFly.age, EN) Age
/*NOTE(TsetseFly.age, EN)
Age is a continuous quantity in this model.
A unit of age is a year.
*/
//EN Report time
REPORT_TIME report_time = { 0 };
//EN Alive
logical alive = {TRUE};
/*NOTE(TsetseFly.alive, EN)
Set to TRUE when the actor starts, and to FALSE just before the actor finishes.
Since the numeric value of TRUE is 1 and FALSE is 0, this variable
can also be used to count actors in tables.
*/
LIFESTAGE lifestage = {PUPA}; //EN Life stage
event timeMortalityEvent, MortalityEvent; //EN Mortality event
//LABEL(TsetseFly.Start, EN) Starts the actor
void Start();
//LABEL(TsetseFly.Finish, EN) Finishes the actor
void Finish();
};
/*NOTE(TsetseFly.Start, EN)
The Start function initializes actor variables before simulation
of the actor commences.
*/
void TsetseFly::Start()
{
// Modgen initializes all actor variables
// before the code in this function is executed.
age = 0;
// After the code in this function is executed,
// Modgen initializes events and tables for the actor.
// Modgen also outputs starting values to the tracking file if requested.
}
/*NOTE(TsetseFly.Finish, EN)
The Finish function terminates the simulation of an actor.
*/
void TsetseFly::Finish()
{
// After the code in this function is executed,
// Modgen removes the actor from tables and from the simulation.
// Modgen also recuperates any memory used by the actor.
}
/*NOTE(DurationOfLife, EN)
This table contains statistics related to the duration of life.
*/
table TsetseFly DurationOfLife //EN Duration of Life
{
lifestage*
{
value_in(alive), //EN Population size
min_value_out(duration()), //EN Minimum duration of life decimals=4
max_value_out(duration()), //EN Maximum duration of life decimals=4
duration() / value_in(alive) //EN Life expectancy decimals=4
} //EN Demographic characteristics
};