Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -935,3 +935,22 @@ with gr.Blocks(theme=gr.themes.Monochrome()) as demo:
|
|
| 935 |
|
| 936 |
|
| 937 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 935 |
|
| 936 |
|
| 937 |
|
| 938 |
+
# Function to call when button is clicked
|
| 939 |
+
def run_simulation_and_plot(*args):
|
| 940 |
+
fig = run_and_plot_simulation(*args)
|
| 941 |
+
return fig
|
| 942 |
+
|
| 943 |
+
# Setting up the button click event
|
| 944 |
+
button.click(
|
| 945 |
+
run_simulation_and_plot,
|
| 946 |
+
inputs=[separate_agent_types,n_agents_slider, share_regime_slider, threshold_slider, social_learning_slider,
|
| 947 |
+
steps_slider, half_life_slider, physical_network_type_random_geometric_radius,physical_network_type_random_geometric_powerlaw_exponent,physical_network_type,
|
| 948 |
+
introduce_physical_homophily_true_false,physical_homophily,
|
| 949 |
+
introduce_social_media_homophily_true_false,social_media_homophily,social_media_network_type_random_geometric_radius,social_media_network_type_powerlaw_exponent,social_media_network_type,use_social_media_network],
|
| 950 |
+
outputs=[plot_output,network_output]
|
| 951 |
+
)
|
| 952 |
+
|
| 953 |
+
# Launch the interface
|
| 954 |
+
if __name__ == "__main__":
|
| 955 |
+
demo.launch(debug=True)
|
| 956 |
+
|