Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cats
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
BDC
cats
Commits
f28c299e
Commit
f28c299e
authored
2 years ago
by
Andreas Gattringer
Browse files
Options
Downloads
Patches
Plain Diff
butterflies: forgot to add random walk to dispersal changes to previous commit
parent
bff5b175
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/modules/butterflies/butterflies_actions.c
+7
-37
7 additions, 37 deletions
src/modules/butterflies/butterflies_actions.c
with
7 additions
and
37 deletions
src/modules/butterflies/butterflies_actions.c
+
7
−
37
View file @
f28c299e
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
#include
"butterflies_main.h"
#include
"butterflies_main.h"
#include
"inline_overlays.h"
#include
"inline_overlays.h"
#include
"butterflies_populations.h"
#include
"butterflies_populations.h"
#include
"random_walk.h"
#include
"butterflies_inline.h"
#include
"butterflies_inline.h"
#include
"grids/grid_wrapper.h"
#include
"grids/grid_wrapper.h"
#include
"grids/gdal_save.h"
#include
"grids/gdal_save.h"
...
@@ -16,6 +16,8 @@
...
@@ -16,6 +16,8 @@
#include
"populations/population.h"
#include
"populations/population.h"
#include
"inline_population.h"
#include
"inline_population.h"
#include
"butterflies_generations.h"
#include
"butterflies_generations.h"
#include
"butterflies_dispersal.h"
#include
"butterflies_overlays.h"
inline
void
increase_custom_stat
(
struct
statistics
stats
,
int64_t
stat_id
,
int64_t
by
)
inline
void
increase_custom_stat
(
struct
statistics
stats
,
int64_t
stat_id
,
int64_t
by
)
...
@@ -86,7 +88,7 @@ void grid_butterflies_dispersal(struct cats_grid *grid, struct cats_thread_info
...
@@ -86,7 +88,7 @@ void grid_butterflies_dispersal(struct cats_grid *grid, struct cats_thread_info
continue
;
continue
;
}
}
butterflies_
random_w
al
k
(
grid
,
ts
,
row
,
col
,
false
);
butterflies_
cell_dispers
al
(
grid
,
ts
,
row
,
col
,
false
);
}
}
}
}
// if (ts->temp) printf("thread %d: %ld random walks (%ld cells) avg %f\n", ts->id, ts->temp, ts->temp1, (float) ts->temp / (float) ts->temp1);
// if (ts->temp) printf("thread %d: %ld random walks (%ld cells) avg %f\n", ts->id, ts->temp, ts->temp1, (float) ts->temp / (float) ts->temp1);
...
@@ -222,7 +224,7 @@ enum action_status action_butterfly_update_generations(struct cats_grid *grid, s
...
@@ -222,7 +224,7 @@ enum action_status action_butterfly_update_generations(struct cats_grid *grid, s
grid
->
param
.
initial_population
.
adjusted
=
true
;
grid
->
param
.
initial_population
.
adjusted
=
true
;
}
}
threaded_action
(
&
grid
_update_generations
,
grid
,
conf
,
TS_DEFAULT
);
threaded_action
(
&
area
_update_generations
,
grid
,
conf
,
TS_DEFAULT
);
return
ACTION_RUN
;
return
ACTION_RUN
;
}
}
...
@@ -242,45 +244,13 @@ void reset_info_layer(const struct cats_grid *grid, struct grid_data_butterflies
...
@@ -242,45 +244,13 @@ void reset_info_layer(const struct cats_grid *grid, struct grid_data_butterflies
enum
action_status
action_butterflies_update_overlays
(
struct
cats_grid
*
grid
,
struct
cats_configuration
*
conf
)
enum
action_status
action_butterflies_update_overlays
(
struct
cats_grid
*
grid
,
struct
cats_configuration
*
conf
)
{
{
return
butterflies_update_overlays
(
conf
,
grid
);
int
module_id
=
CATS_MODULE_ID
;
struct
grid_data_butterflies
*
data
=
grid
->
grid_modules
[
module_id
].
module_data
;
if
(
conf
->
overlays
.
have_overlays
==
false
)
{
return
ACTION_NOT_RUN
;
}
const
cats_dt_coord
rows
=
grid
->
dimension
.
rows
;
const
cats_dt_coord
cols
=
grid
->
dimension
.
cols
;
for
(
cats_dt_coord
row
=
0
;
row
<
rows
;
row
++
)
{
for
(
cats_dt_coord
col
=
0
;
col
<
cols
;
col
++
)
{
data
->
info_layer
[
row
][
col
]
=
BF_CELL_CLEAR
;
if
(
cell_excluded_by_overlay
(
conf
,
row
,
col
))
{
data
->
info_layer
[
row
][
col
]
|=
BF_CELL_EXCLUDED
;
}
if
(
conf
->
overlays
.
overlay
[
OL_HABITAT_TYPE_CC
].
enabled
&&
conf
->
overlays
.
habitat_cc
->
data
[
row
][
col
]
>
0
)
{
data
->
info_layer
[
row
][
col
]
|=
BF_CELL_HABITAT_OK
;
}
if
(
conf
->
overlays
.
overlay
[
OL_RESOURCE
].
enabled
&&
conf
->
overlays
.
resources
->
data
[
row
][
col
]
>
0
)
{
data
->
info_layer
[
row
][
col
]
|=
BF_CELL_RESOURCE_AVAILABLE
;
}
}
}
return
ACTION_RUN
;
}
}
enum
action_status
action_finish_generation
(
struct
cats_grid
*
grid
,
struct
cats_configuration
*
conf
)
enum
action_status
action_finish_generation
(
struct
cats_grid
*
grid
,
struct
cats_configuration
*
conf
)
{
{
int
module_id
=
CATS_MODULE_ID
;
const
int
module_id
=
CATS_MODULE_ID
;
struct
grid_data_butterflies
*
data
=
grid
->
grid_modules
[
module_id
].
module_data
;
struct
grid_data_butterflies
*
data
=
grid
->
grid_modules
[
module_id
].
module_data
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment