Skip to content
Snippets Groups Projects
Commit 82a118ee authored by NGUYEN Do Duc Anh's avatar NGUYEN Do Duc Anh
Browse files

check traffic model

parent a5b0923d
No related branches found
No related tags found
No related merge requests found
......@@ -46,6 +46,7 @@ def generate_and_send_traffic_matrix():
mean_rate = 1000
else:
mean_rate = round((f * A[i] * P_values[j]) / sum(P_values) + ((1 - f) * A[j] * P_values[i]) / sum(P_values))
print("mean_rate", mean_rate, "Ai", A[i], "P_values j", P_values[j], "P_values i", P_values[i], "Aj", "f", f)
traffic_matrix[point_ip_send][point_ip_recv] = mean_rate
......@@ -154,9 +155,9 @@ def main():
A[i] += rate
A[j] += rate
for src_node, value in A_raw.items():
i = int(src_node)
A[i] = A[i] % 10000
scale_factor = 5000 / max(A)
for a in A:
a *= scale_factor
thread = threading.Thread(target=read_and_write_points)
thread.daemon = True
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment