-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPupalDevelopment.mpp
More file actions
36 lines (34 loc) · 1.05 KB
/
PupalDevelopment.mpp
File metadata and controls
36 lines (34 loc) · 1.05 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
TIME Pupa::timeAdultEmerge()
{
return adult_emerge;
}
void Pupa::AdultEmergeEvent()
{
adult_emerge = TIME_INFINITE;
TsetseFly *paTsetseFly = new TsetseFly();
paTsetseFly->Start(gender, cohort);
Finish();
}
double Pupa::ADULT_EMERGE( double current_time, double k, double a, double b )
{
double puparial_period = int(current_time) - current_time;
double sum = (k / (1 + exp( a + b * DailyAvgTemperature[RANGE_POS( REPORT_TIME, int(current_time + puparial_period) )])))*puparial_period;
while ( sum < 1 )
{
sum += k / (1 + exp( a + b * DailyAvgTemperature[RANGE_POS( REPORT_TIME, int(current_time + puparial_period) )]));
puparial_period++;
if (sum > 1)
{
double time_reduction = (sum-1)/( k / (1 + exp( a + b * DailyAvgTemperature[RANGE_POS( REPORT_TIME, int(current_time + puparial_period) )])) );
//puparial_period = puparial_period - time_reduction;
if(time_reduction >= 0.375)
{
puparial_period = puparial_period - 1 + 0.625;
} else
{
puparial_period = puparial_period - 1 + 1.625;
}
}
}
return puparial_period;
};