Update app.py
Browse files
app.py
CHANGED
|
@@ -87,29 +87,35 @@ network_routes = sdn_load_balancer(graph, demand_predictions) # Compute SDN-bas
|
|
| 87 |
anomalies = detect_anomalies(df) # Detect anomalies
|
| 88 |
|
| 89 |
# Streamlit UI
|
| 90 |
-
st.set_page_config(layout="wide")
|
| 91 |
-
st.title("Smart Network Resource Allocation with SDN Load Balancing
|
|
|
|
| 92 |
|
| 93 |
-
col1, col2 = st.columns(2)
|
| 94 |
|
| 95 |
with col1:
|
| 96 |
-
st.subheader("Bandwidth Usage Over Time")
|
| 97 |
-
fig = px.line(df, x="Timestamp", y="Bandwidth_Usage", color="School")
|
| 98 |
st.plotly_chart(fig, use_container_width=True)
|
| 99 |
|
| 100 |
with col2:
|
| 101 |
-
st.subheader("Predicted Bandwidth Allocations")
|
| 102 |
st.dataframe(pd.DataFrame(list(bandwidth_allocation.items()), columns=["School", "Allocated Bandwidth (Mbps)"]))
|
| 103 |
|
| 104 |
-
|
|
|
|
|
|
|
| 105 |
|
| 106 |
with col3:
|
| 107 |
-
st.subheader("SDN-based Load Balancing Routes (Energy Efficient)")
|
| 108 |
st.dataframe(pd.DataFrame([(school, ' -> '.join(path)) for school, path in network_routes.items()], columns=["School", "Route"]))
|
| 109 |
|
| 110 |
with col4:
|
| 111 |
-
st.subheader("Detected Anomalies")
|
| 112 |
if anomalies.empty:
|
| 113 |
-
st.
|
| 114 |
else:
|
| 115 |
st.dataframe(anomalies)
|
|
|
|
|
|
|
|
|
|
|
|
| 87 |
anomalies = detect_anomalies(df) # Detect anomalies
|
| 88 |
|
| 89 |
# Streamlit UI
|
| 90 |
+
st.set_page_config(layout="wide", page_title="Smart Network Allocation", page_icon="🌐")
|
| 91 |
+
st.title("📡 Smart Network Resource Allocation with SDN Load Balancing")
|
| 92 |
+
st.markdown("---")
|
| 93 |
|
| 94 |
+
col1, col2 = st.columns([2, 1])
|
| 95 |
|
| 96 |
with col1:
|
| 97 |
+
st.subheader("📊 Bandwidth Usage Over Time")
|
| 98 |
+
fig = px.line(df, x="Timestamp", y="Bandwidth_Usage", color="School", template="plotly_dark")
|
| 99 |
st.plotly_chart(fig, use_container_width=True)
|
| 100 |
|
| 101 |
with col2:
|
| 102 |
+
st.subheader("🔍 Predicted Bandwidth Allocations")
|
| 103 |
st.dataframe(pd.DataFrame(list(bandwidth_allocation.items()), columns=["School", "Allocated Bandwidth (Mbps)"]))
|
| 104 |
|
| 105 |
+
st.markdown("---")
|
| 106 |
+
|
| 107 |
+
col3, col4 = st.columns([1, 1])
|
| 108 |
|
| 109 |
with col3:
|
| 110 |
+
st.subheader("🔗 SDN-based Load Balancing Routes (Energy Efficient)")
|
| 111 |
st.dataframe(pd.DataFrame([(school, ' -> '.join(path)) for school, path in network_routes.items()], columns=["School", "Route"]))
|
| 112 |
|
| 113 |
with col4:
|
| 114 |
+
st.subheader("⚠️ Detected Anomalies")
|
| 115 |
if anomalies.empty:
|
| 116 |
+
st.success("No anomalies detected")
|
| 117 |
else:
|
| 118 |
st.dataframe(anomalies)
|
| 119 |
+
|
| 120 |
+
st.markdown("---")
|
| 121 |
+
st.caption("Developed for optimized network performance and efficient bandwidth allocation ⚡")
|