From 31c957c33db7213cd35496399c35203f11d00598 Mon Sep 17 00:00:00 2001 From: Himank Date: Sat, 14 Mar 2026 12:22:50 +0530 Subject: [PATCH 1/4] fix: use absolute path for aco_tsp data file --- examples/aco_tsp/app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/aco_tsp/app.py b/examples/aco_tsp/app.py index 155d5f8d4..46694e7bd 100644 --- a/examples/aco_tsp/app.py +++ b/examples/aco_tsp/app.py @@ -2,6 +2,7 @@ import networkx as nx import solara +import os from aco_tsp.model import AcoTspModel, TSPGraph from matplotlib.figure import Figure from mesa.visualization import SolaraViz, make_plot_component @@ -11,7 +12,7 @@ def circle_portrayal_example(agent): return {"node_size": 20, "width": 0.1} -tsp_graph = TSPGraph.from_tsp_file("aco_tsp/data/kroA100.tsp") +tsp_graph = TSPGraph.from_tsp_file(os.path.join(os.path.dirname(__file__), "aco_tsp/data/kroA100.tsp")) model_params = { "num_agents": tsp_graph.num_cities, "tsp_graph": tsp_graph, From 25b9e568c3f7dffae765d9cdc9034186009e16dd Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 14 Mar 2026 07:12:36 +0000 Subject: [PATCH 2/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- examples/aco_tsp/app.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/examples/aco_tsp/app.py b/examples/aco_tsp/app.py index 46694e7bd..f95fe5a11 100644 --- a/examples/aco_tsp/app.py +++ b/examples/aco_tsp/app.py @@ -1,8 +1,9 @@ """Configure visualization elements and instantiate a server""" +import os + import networkx as nx import solara -import os from aco_tsp.model import AcoTspModel, TSPGraph from matplotlib.figure import Figure from mesa.visualization import SolaraViz, make_plot_component @@ -12,7 +13,9 @@ def circle_portrayal_example(agent): return {"node_size": 20, "width": 0.1} -tsp_graph = TSPGraph.from_tsp_file(os.path.join(os.path.dirname(__file__), "aco_tsp/data/kroA100.tsp")) +tsp_graph = TSPGraph.from_tsp_file( + os.path.join(os.path.dirname(__file__), "aco_tsp/data/kroA100.tsp") +) model_params = { "num_agents": tsp_graph.num_cities, "tsp_graph": tsp_graph, From 43b46b3625d0aeaae2525e0e8162b478fe1a717d Mon Sep 17 00:00:00 2001 From: Himank Date: Sun, 15 Mar 2026 20:52:27 +0530 Subject: [PATCH 3/4] fix: correct path to aco_tsp/data/kroA100.tsp relative to app.py --- examples/aco_tsp/app.py | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/aco_tsp/app.py b/examples/aco_tsp/app.py index 46694e7bd..f792ebb4b 100644 --- a/examples/aco_tsp/app.py +++ b/examples/aco_tsp/app.py @@ -11,7 +11,6 @@ def circle_portrayal_example(agent): return {"node_size": 20, "width": 0.1} - tsp_graph = TSPGraph.from_tsp_file(os.path.join(os.path.dirname(__file__), "aco_tsp/data/kroA100.tsp")) model_params = { "num_agents": tsp_graph.num_cities, From 9d22723918cfb6371ea3364e965625f5babed707 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 15 Mar 2026 15:30:36 +0000 Subject: [PATCH 4/4] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- examples/aco_tsp/app.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/aco_tsp/app.py b/examples/aco_tsp/app.py index 4f4921d28..71753a09c 100644 --- a/examples/aco_tsp/app.py +++ b/examples/aco_tsp/app.py @@ -1,5 +1,7 @@ """Configure visualization elements and instantiate a server""" + import os + import networkx as nx import solara from aco_tsp.model import AcoTspModel, TSPGraph @@ -70,4 +72,4 @@ def ant_level_distances(model): ], model_params=model_params, play_interval=1, -) \ No newline at end of file +)