OmriKaduri / mapf-selection

Multi-Agent Path Finding Algorithm Selection Framework
6 stars 5 forks source link

Error when trying to re-generate scenarios for the updated room-64-64-16 map #2

Open eli-b opened 3 years ago

eli-b commented 3 years ago

The room-64-64-16.map file was recently updated, necessitating regeneration of the scenarios. I ran create_problems_for_map(r'D:\mapf\maps\room-64-64-16.map', 2, 300) and ran into the following error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-2-5181f86f5750> in <module>
----> 1 create_problems_for_map(r'D:\mapf\maps\room-64-64-16.map', 2, 300)

D:\mapf-selection\src\utils\mapf_graph_generator.py in create_problems_for_map(map_path, n_instances, n_agents)
    157                 additional_info = "-" + start_side + '-to-' + goal_side
    158                 if problem_type == 'cross-sides':
--> 159                     graph.create_sided_problem(n_agents, start_side, instanceid, swap_sides=False)
    160                 elif problem_type == 'swap-sides':
    161                     graph.create_sided_problem(n_agents, start_side, instanceid, swap_sides=True)

D:\mapf-selection\src\utils\mapf_graph_generator.py in create_sided_problem(self, n_agents, start_side, instanceid, swap_sides)
    100             if start is None:
    101                 break
--> 102             self.add_agent_to_graph(start, goal)
    103
    104     # When outside_in = True, creates the agents start location far from center

D:\mapf-selection\src\utils\mapfgraph.py in add_agent_to_graph(self, start, goal, color)
    141         self.G.nodes[start_1d]['type'] = 'agent_start'
    142
--> 143         self.G.node[goal_1d]['color'] = goal_color
    144         self.G.node[goal_1d]['size'] = 1
    145         self.G.nodes[goal_1d]['type'] = 'agent_goal'

AttributeError: 'DiGraph' object has no attribute 'node'
Omri-CG commented 3 years ago

Seems like you are using a different version of networkx, which is related to your other issue #1. I'll try to upload a list of requirements in the future. Meanwhile, what version of networkx are you using? I used 2.2.

eli-b commented 3 years ago

I agree issue #1 is probably the root cause. To answer your question, I used networkx version 2.5.1.

eli-b commented 3 years ago

networkx version 2.2 is unusable with Python 3.9 (because fractions.gcd() had been removed). It would be great if you could update the code to use a newer version of networkx.