zhm-real před 5 roky
rodič
revize
6cb8928fa4

+ 2 - 3
Search-based Planning/.idea/workspace.xml

@@ -3,8 +3,7 @@
   <component name="ChangeListManager">
     <list default="true" id="025aff36-a6aa-4945-ab7e-b2c625055f47" name="Default Changelist" comment="">
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/bfs.py" beforeDir="false" afterPath="$PROJECT_DIR$/bfs.py" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/dfs.py" beforeDir="false" afterPath="$PROJECT_DIR$/dfs.py" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/plotting.py" beforeDir="false" afterPath="$PROJECT_DIR$/plotting.py" afterDir="false" />
     </list>
     <option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
     <option name="SHOW_DIALOG" value="false" />
@@ -152,9 +151,9 @@
     <recent_temporary>
       <list>
         <item itemvalue="Python.a_star" />
+        <item itemvalue="Python.dijkstra" />
         <item itemvalue="Python.dfs" />
         <item itemvalue="Python.bfs" />
-        <item itemvalue="Python.dijkstra" />
         <item itemvalue="Python.searching" />
       </list>
     </recent_temporary>

binární
Search-based Planning/__pycache__/plotting.cpython-37.pyc


binární
Search-based Planning/gif/Astar.gif


binární
Search-based Planning/gif/BFS.gif


binární
Search-based Planning/gif/DFS.gif


binární
Search-based Planning/gif/Dijkstra.gif


+ 5 - 1
Search-based Planning/plotting.py

@@ -40,7 +40,11 @@ def animation(xI, xG, obs, path, visited, name):
         plt.plot(x[0], x[1], linewidth='3', color='#808080', marker='o')
         plt.gcf().canvas.mpl_connect('key_release_event',
                                      lambda event: [exit(0) if event.key == 'escape' else None])
-        if count % 20 == 0: plt.pause(0.01)
+        if count < 500: length = 20
+        elif count < 700: length = 30
+        else: length = 50
+
+        if count % length == 0: plt.pause(0.001)
 
     # plot optimal path
     path_x = [path[i][0] for i in range(len(path))]