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

fix set link

parent 07431a56
Branches
No related tags found
No related merge requests found
......@@ -227,7 +227,7 @@ class GNS3Manager:
@staticmethod
def set_link_filter(link_id, packet_lost):
global PROJECT_ID, username, password
url = f"http://localhost:3080/v2/projects/{PROJECT_ID}/links"
url = f"http://localhost:3080/v2/projects/{PROJECT_ID}/links/{link_id}"
data = {"filters": {"packet_lost": [packet_lost]}}
......
......@@ -96,7 +96,9 @@ def generate_topohub_GNS3_topology():
topo = topohub.get(topology_name)
g = nx.node_link_graph(topo)
P_values = np.random.lognormal(mean=0, sigma=1, size=g.graph['stats']['nodes']).tolist()
# P_values = np.random.lognormal(mean=0, sigma=1, size=g.graph['stats']['nodes']).tolist()
P_values = [0.49729683886415604, 2.8478372536019494, 0.5638497692033089, 1.7066441178756397, 1.0955777113276581, 0.6624609705231256, 1.2170507302967504, 2.241922851235645,
0.9904057794366734, 0.10045359874192523, 0.1331217360266883, 0.7161751639559052]
print("P_values:", P_values)
# Extract X (longitude) and Y (latitude) positions
......
......@@ -158,6 +158,7 @@ def main():
scale_factor = 5000 / max(A)
for i in range(len(A)):
A[i] *= scale_factor
print(f"A[{i}]", A[i])
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