Devashri commited on
Commit
e388d3f
·
verified ·
1 Parent(s): 4e3d344

Update SIR_model.py

Browse files
Files changed (1) hide show
  1. SIR_model.py +2 -7
SIR_model.py CHANGED
@@ -11,7 +11,7 @@ import os
11
  import sys
12
  import streamlit as st
13
 
14
- def main(mode=None):
15
  # Initialize the Model
16
  sir_model = Model(id="SIR_Model")
17
 
@@ -19,12 +19,7 @@ def main(mode=None):
19
  sir_graph = Graph(id="SIR_Graph")
20
  sir_model.graphs.append(sir_graph)
21
 
22
- # Get user inputs for model parameters
23
- total_population = st.number_input("Total Population", min_value=1, value=1000, step=1)
24
- initial_infected = st.number_input("Initial Infected Population", min_value=0, max_value=total_population, value=1)
25
- initial_recovered = st.number_input("Initial Recovered Population", min_value=0, max_value=total_population - initial_infected, value=0)
26
- beta = st.slider("Infection Rate (β)", min_value=0.0, max_value=1.0, value=0.3, step=0.01)
27
- gamma = st.slider("Recovery Rate (γ)", min_value=0.0, max_value=1.0, value=0.1, step=0.01)
28
 
29
  # # Parameters for the model
30
  # total_population = 1000
 
11
  import sys
12
  import streamlit as st
13
 
14
+ def main(total_population, initial_infected, initial_recovered, beta, gamma, mode=None):
15
  # Initialize the Model
16
  sir_model = Model(id="SIR_Model")
17
 
 
19
  sir_graph = Graph(id="SIR_Graph")
20
  sir_model.graphs.append(sir_graph)
21
 
22
+
 
 
 
 
 
23
 
24
  # # Parameters for the model
25
  # total_population = 1000