-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample_multi_environment.json
More file actions
276 lines (268 loc) · 7.47 KB
/
example_multi_environment.json
File metadata and controls
276 lines (268 loc) · 7.47 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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
{
"metadata": {
"model_name": "Multi-Environment Ecosystem Model",
"description": "A model simulating wildlife movement between forest and urban environments with different behaviors in each habitat.",
"author": "Ross Williams",
"date_created": "2024-01-15T10:30:00Z",
"version": "1.0.0",
"random_seed": 42
},
"functions": [
{
"name": "calculate_food_availability",
"description": "Calculates food availability based on vegetation density",
"language": "python",
"code": "return vegetation_layer * season_multiplier"
}
],
"global_variables": [
{
"name": "current_season",
"type": "string",
"initial_value": "spring",
"description": "Current season affecting resource availability"
},
{
"name": "simulation_day",
"type": "integer",
"initial_value": 0,
"description": "Current day of simulation"
}
],
"environments": [
{
"name": "forest",
"topology": {
"type": "grid",
"description": "200x200 grid representing forest habitat",
"parameters": {
"width": 200,
"height": 200,
"cell_size": 10
},
"boundary_conditions": "torus"
},
"spatial_layers": [
{
"layer_name": "vegetation_density",
"layer_type": "raster",
"source_file": "data/forest_vegetation.tif",
"description": "Vegetation density from 0-1 affecting food availability"
},
{
"layer_name": "water_sources",
"layer_type": "vector",
"source_file": "data/forest_streams.shp",
"description": "Stream and pond locations for water access"
}
],
"attributes": [
{
"name": "temperature",
"type": "float",
"initial_value": 15.5,
"description": "Average temperature in Celsius"
},
{
"name": "canopy_cover",
"type": "float",
"initial_value": 0.8,
"description": "Proportion of area under tree canopy"
}
],
"environment_behaviors": [
{
"rule_name": "seasonal_growth",
"description": "Vegetation grows and changes with seasons",
"effect": "vegetation_density *= seasonal_growth_rate"
}
]
},
{
"name": "urban",
"topology": {
"type": "network",
"description": "Road network connecting urban patches",
"parameters": {
"node_file": "data/urban_nodes.csv",
"edge_file": "data/urban_roads.csv"
}
},
"spatial_layers": [
{
"layer_name": "building_footprints",
"layer_type": "vector",
"source_file": "data/buildings.shp",
"description": "Building polygons blocking movement"
},
{
"layer_name": "green_spaces",
"layer_type": "vector",
"source_file": "data/parks.shp",
"description": "Parks and green corridors providing refuge"
}
],
"attributes": [
{
"name": "noise_level",
"type": "float",
"initial_value": 65.0,
"description": "Average noise level in decibels"
},
{
"name": "human_activity",
"type": "float",
"initial_value": 0.7,
"description": "Level of human activity from 0-1"
}
],
"environment_behaviors": [
{
"rule_name": "traffic_cycles",
"description": "Human activity varies by time of day",
"effect": "human_activity = calculate_traffic_pattern(time_of_day)"
}
]
}
],
"agents": [
{
"agent_type": "deer",
"count": 50,
"attributes": [
{
"name": "energy",
"type": "float",
"initial_value": 100.0,
"description": "Current energy level"
},
{
"name": "current_environment",
"type": "string",
"initial_value": "forest",
"description": "Which environment the agent is currently in"
},
{
"name": "stress_level",
"type": "float",
"initial_value": 0.0,
"description": "Stress from 0-1, higher in urban areas"
}
],
"behaviors": [
{
"behavior_name": "forage",
"description": "Search for food in current environment",
"rules": "if current_environment == 'forest': energy += vegetation_density * 5; else: energy += green_space_proximity * 2"
},
{
"behavior_name": "avoid_humans",
"description": "Move away from high human activity areas",
"rules": "if human_activity > 0.5: stress_level += 0.1; move_to_lower_activity_area()"
},
{
"behavior_name": "migrate_environment",
"description": "Move between forest and urban environments",
"rules": "if stress_level > 0.8 and current_environment == 'urban': migrate_to('forest')"
}
]
},
{
"agent_type": "bird",
"count": 200,
"attributes": [
{
"name": "energy",
"type": "float",
"initial_value": 80.0,
"description": "Current energy level"
},
{
"name": "nesting_site",
"type": "string",
"initial_value": "forest",
"description": "Preferred nesting environment"
}
],
"behaviors": [
{
"behavior_name": "fly_between_environments",
"description": "Birds can easily move between habitats",
"rules": "if food_scarcity > 0.6: fly_to_better_habitat()"
}
]
}
],
"scheduler": {
"mode": "discrete_time",
"activation": {
"type": "staged",
"stages": [
{
"name": "environment_update",
"agent_types": [],
"order": "sequential"
},
{
"name": "animal_behaviors",
"agent_types": ["deer", "bird"],
"order": "random"
}
]
},
"duration": 365,
"time_unit": "days",
"time_step_size": 1,
"local_schedulers": [
{
"scope": "environment",
"name": "forest_scheduler",
"activation": {
"type": "sequential"
}
},
{
"scope": "environment",
"name": "urban_scheduler",
"activation": {
"type": "simultaneous"
}
}
]
},
"outputs": {
"tracked_variables": [
{
"variable": "deer.energy",
"description": "Track deer energy levels across environments",
"collection_frequency": "each_step"
},
{
"variable": "deer.current_environment",
"description": "Track which environment deer are in",
"collection_frequency": "each_step"
},
{
"variable": "forest.vegetation_density",
"description": "Monitor forest health over time",
"collection_frequency": "each_step"
}
],
"visualizations": [
{
"type": "heatmap",
"data_source": ["deer.current_environment"],
"description": "Spatial distribution of deer across environments",
"visual_params": {
"color_map": "viridis",
"update_frequency": "daily"
}
},
{
"type": "timeseries",
"data_source": ["deer.energy", "deer.stress_level"],
"description": "Deer health metrics over simulation time"
}
]
}
}