-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.R
More file actions
65 lines (57 loc) · 1.58 KB
/
Copy pathexample.R
File metadata and controls
65 lines (57 loc) · 1.58 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
library(beehave.go.r)
# Create a weather vector with mostly no foraging (0 hours)
# but 90 random days with 15 hours of foraging time
weather_vector <- rep(0, 365)
collection_days <- 120
weather_vector[sample(70:265, collection_days)] <- sample(
0:15,
collection_days,
replace = TRUE
)
# Source all R scripts
experiment <- beehave_init(add_default = FALSE) |>
# add_weather_file(
# "dev/data/weather_402.txt"
# ) |>
add_flower_patches_from_map(
landuse_map = "dev/data/preidl-etal-RSE-2020_land-cover-classification-germany-2016.tif",
lookup_table = "dev/data/NectarPollenLookUp.csv",
location = data.frame(lat = 48.2, lon = 7.80003),
min_polygon_size = 5000
) |>
add_weather_vector(weather_vector) |>
add_parameter(
list(
# InitialPatches = list(
# Patches = list(
# list(
# DistToColony = 1000,
# ConstantPatch = list(
# Nectar = 5,
# Pollen = 1,
# NectarConcentration = 1,
# DetectionProbability = 0.5
# )
# ),
# list(
# DistToColony = 200,
# SeasonalPatch = list(
# MaxNectar = 20,
# MaxPollen = 10,
# NectarConcentration = 1.5,
# DetectionProbability = 0.2,
# SeasonShift = 20
# )
# )
# )
# ),
reporters = c(
"worker_cohorts",
"stores"
)
)
)
plot_patches_map(experiment)
print(experiment)
test <- run_simulation(experiment)
bcs_plot_series(test, group = "stores")