safiaa02 commited on
Commit
1022911
·
verified ·
1 Parent(s): ac21611

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -8
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
- fig = px.line(df, x="Timestamp", y="Bandwidth_Usage", color="School", title="Bandwidth Usage Over Time")
86
- st.plotly_chart(fig)
87
 
88
- st.write("Predicted Bandwidth Allocations:")
89
- st.table(pd.DataFrame(list(bandwidth_allocation.items()), columns=["School", "Allocated Bandwidth (Mbps)"]))
 
 
90
 
91
- st.write("SDN-based Load Balancing Routes:")
92
- st.table(pd.DataFrame([(school, ' -> '.join(path)) for school, path in network_routes.items()], columns=["School", "Route"]))
 
93
 
94
- st.write("Detected Anomalies:")
95
- st.dataframe(anomalies)
 
 
 
 
 
 
 
 
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)