Spaces:
Runtime error
Runtime error
Commit
·
108442d
1
Parent(s):
ab7379e
ui: added earthquake simulation options
Browse filesoptions: 'legacy' and 'monte carlo'
and 'max_trials' if 'monte carlo' is selected
tomorrowcities/pages/engine.py
CHANGED
|
@@ -50,6 +50,9 @@ def create_new_app_state():
|
|
| 50 |
'landslide_trigger_level': solara.reactive('moderate'),
|
| 51 |
'landslide_trigger_level_list': ['minor','moderate','severe'],
|
| 52 |
'earthquake_intensity_unit': solara.reactive('m/s2'),
|
|
|
|
|
|
|
|
|
|
| 53 |
'cdf_median_increase_in_percent': solara.reactive(0.2),
|
| 54 |
'threshold_increase_culvert_water_height': solara.reactive(0.2),
|
| 55 |
'threshold_increase_road_water_height': solara.reactive(0.2),
|
|
@@ -1525,7 +1528,11 @@ def ExecutePanel():
|
|
| 1525 |
with solara.Row(justify="left"):
|
| 1526 |
solara.ToggleButtonsSingle(value=layers.value['hazard'].value, on_value=layers.value['hazard'].set, values=layers.value['hazard_list'])
|
| 1527 |
if layers.value['hazard'].value == 'earthquake':
|
| 1528 |
-
solara.
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1529 |
if layers.value['hazard'].value == 'landslide':
|
| 1530 |
solara.Markdown("#### Landslide trigger level")
|
| 1531 |
with solara.Row(justify="left"):
|
|
|
|
| 50 |
'landslide_trigger_level': solara.reactive('moderate'),
|
| 51 |
'landslide_trigger_level_list': ['minor','moderate','severe'],
|
| 52 |
'earthquake_intensity_unit': solara.reactive('m/s2'),
|
| 53 |
+
'earthquake_simulation_methods': ["legacy","monte carlo"],
|
| 54 |
+
'earthquake_simulation_method_selected': solara.reactive('legacy'),
|
| 55 |
+
'earthquake_simulation_trial_count': solara.reactive(5),
|
| 56 |
'cdf_median_increase_in_percent': solara.reactive(0.2),
|
| 57 |
'threshold_increase_culvert_water_height': solara.reactive(0.2),
|
| 58 |
'threshold_increase_road_water_height': solara.reactive(0.2),
|
|
|
|
| 1528 |
with solara.Row(justify="left"):
|
| 1529 |
solara.ToggleButtonsSingle(value=layers.value['hazard'].value, on_value=layers.value['hazard'].set, values=layers.value['hazard_list'])
|
| 1530 |
if layers.value['hazard'].value == 'earthquake':
|
| 1531 |
+
with solara.Column(gap='40px'):
|
| 1532 |
+
solara.Select(label='unit of earthquake intensity map', values=['m/s2','g'], value=layers.value['earthquake_intensity_unit'])
|
| 1533 |
+
solara.Select(label='earthquake simulation method', values=layers.value['earthquake_simulation_methods'], value=layers.value['earthquake_simulation_method_selected'])
|
| 1534 |
+
if layers.value['earthquake_simulation_method_selected'].value == 'monte carlo':
|
| 1535 |
+
solara.InputInt(label='Number of trials',value=layers.value['earthquake_simulation_trial_count'])
|
| 1536 |
if layers.value['hazard'].value == 'landslide':
|
| 1537 |
solara.Markdown("#### Landslide trigger level")
|
| 1538 |
with solara.Row(justify="left"):
|