Update app.py
Browse files
app.py
CHANGED
|
@@ -80,16 +80,26 @@ network_routes = sdn_load_balancer(graph, demand_predictions) # Compute SDN-bas
|
|
| 80 |
anomalies = detect_anomalies(df) # Detect anomalies
|
| 81 |
|
| 82 |
# Streamlit UI
|
|
|
|
| 83 |
st.title("Smart Network Resource Allocation with SDN Load Balancing")
|
| 84 |
|
| 85 |
-
|
| 86 |
-
st.plotly_chart(fig)
|
| 87 |
|
| 88 |
-
|
| 89 |
-
st.
|
|
|
|
|
|
|
| 90 |
|
| 91 |
-
|
| 92 |
-
st.
|
|
|
|
| 93 |
|
| 94 |
-
st.
|
| 95 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
anomalies = detect_anomalies(df) # Detect anomalies
|
| 81 |
|
| 82 |
# Streamlit UI
|
| 83 |
+
st.set_page_config(layout="wide")
|
| 84 |
st.title("Smart Network Resource Allocation with SDN Load Balancing")
|
| 85 |
|
| 86 |
+
col1, col2 = st.columns(2)
|
|
|
|
| 87 |
|
| 88 |
+
with col1:
|
| 89 |
+
st.subheader("Bandwidth Usage Over Time")
|
| 90 |
+
fig = px.line(df, x="Timestamp", y="Bandwidth_Usage", color="School")
|
| 91 |
+
st.plotly_chart(fig, use_container_width=True)
|
| 92 |
|
| 93 |
+
with col2:
|
| 94 |
+
st.subheader("Predicted Bandwidth Allocations")
|
| 95 |
+
st.dataframe(pd.DataFrame(list(bandwidth_allocation.items()), columns=["School", "Allocated Bandwidth (Mbps)"]))
|
| 96 |
|
| 97 |
+
col3, col4 = st.columns(2)
|
| 98 |
+
|
| 99 |
+
with col3:
|
| 100 |
+
st.subheader("SDN-based Load Balancing Routes")
|
| 101 |
+
st.dataframe(pd.DataFrame([(school, ' -> '.join(path)) for school, path in network_routes.items()], columns=["School", "Route"]))
|
| 102 |
+
|
| 103 |
+
with col4:
|
| 104 |
+
st.subheader("Detected Anomalies")
|
| 105 |
+
st.dataframe(anomalies)
|