Skip to content

Commit e146bab

Browse files
continue fuzzy
1 parent 13d48ec commit e146bab

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

data/moisture.csv

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
80,1.830057
1+
80,1.830057
2+
45,1.902554
3+
46,1.900443
4+
48,1.896229

src/Math.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ double Math1::calculateWindKoef(const cell *c, directions InvestigatedDirection)
5151
return result;
5252
}
5353

54+
int round_to_4(int digit){
55+
int round_to = 4;
56+
return (digit + round_to - 1) & -round_to;
57+
}
58+
5459
double Math1::calculateGroundSlopeKoef(directions InvestigatedDirection, int altitudeDifference) const
5560
{
5661
clock_t start = clock();
@@ -114,7 +119,7 @@ double Math1::calculateBiomassKoef(const cell *c) const
114119
double Math1::calculateMoistureKoeff(int moisture_percentage) const
115120
{
116121
clock_t start = clock();
117-
122+
moisture_percentage = round_to_4(moisture_percentage);
118123
auto a = moisture_result_[moisture_percentage];
119124
if (a != 0){
120125
clock_t per_iteration = clock() - start;

src/ProfilingDecorator.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,13 @@ bool ProfilingDecorator::willSpread(const cell *c, directions InvestigatedDirect
1111
{
1212
clock_t start = clock();
1313
int direction_difference = c->getWind().get()->directionDifference(InvestigatedDirection);
14-
if (direction_difference > 1){
15-
return false;
16-
}
14+
// if (direction_difference == 4){
15+
// return false;
16+
// } else if (direction_difference >= 2)
17+
// {
18+
// return 4 > (rand() % 100);
19+
// };
20+
1721
auto result = this->primary_class_->willSpread(c, InvestigatedDirection, altitudeDifference);
1822
clock_t per_iteration = clock() - start;
1923
overall_timer_ = per_iteration+overall_timer_;

0 commit comments

Comments
 (0)