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

update showing round

parent 7dd5dc15
Branches
No related tags found
No related merge requests found
......@@ -33,10 +33,12 @@ def print_mapping_state():
global map_security_node
old_map_security = {}
convergence_count = 0
change_count = 0
while True:
print("--- New record ---")
convergence_count += 1
is_changed = False
for id_node in map_security_node.keys():
node = map_security_node[id_node]
print(f"Node {id_node:<5} "
......@@ -48,8 +50,12 @@ def print_mapping_state():
old_map_security[id_node]['state'] = node['state']
old_map_security[id_node]['pointer'] = node['pointer']
convergence_count = 0
is_changed = True
if is_changed:
change_count += 1
print("Convergence count: ", convergence_count)
print("Round (Num of change): ", change_count)
time.sleep(2)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment