@@ -53,10 +53,12 @@ def mov_to_next_obs(self, visited_x, visited_y):
5353 return self .r_x [- 1 ], self .r_y [- 1 ], True
5454
5555 def bug0 (self ):
56- '''Greedy algorithm where you move towards goal
56+ """
57+ Greedy algorithm where you move towards goal
5758 until you hit an obstacle. Then you go around it
5859 (pick an arbitrary direction), until it is possible
59- for you to start moving towards goal in a greedy manner again'''
60+ for you to start moving towards goal in a greedy manner again
61+ """
6062 mov_dir = 'normal'
6163 cand_x , cand_y = - np .inf , - np .inf
6264 if show_animation :
@@ -112,12 +114,14 @@ def bug0(self):
112114 plt .show ()
113115
114116 def bug1 (self ):
115- '''Move towards goal in a greedy manner.
117+ """
118+ Move towards goal in a greedy manner.
116119 When you hit an obstacle, you go around it and
117120 back to where you hit the obstacle initially.
118121 Then, you go to the point on the obstacle that is
119122 closest to your goal and you start moving towards
120- goal in a greedy manner from that new point.'''
123+ goal in a greedy manner from that new point.
124+ """
121125 mov_dir = 'normal'
122126 cand_x , cand_y = - np .inf , - np .inf
123127 exit_x , exit_y = - np .inf , - np .inf
@@ -187,7 +191,8 @@ def bug1(self):
187191 plt .show ()
188192
189193 def bug2 (self ):
190- '''Move towards goal in a greedy manner.
194+ """
195+ Move towards goal in a greedy manner.
191196 When you hit an obstacle, you go around it and
192197 keep track of your distance from the goal.
193198 If the distance from your goal was decreasing before
@@ -196,7 +201,8 @@ def bug2(self):
196201 goal (this may or may not be true because the algorithm
197202 doesn't explore the entire boundary around the obstacle).
198203 So, you depart from this point and continue towards the
199- goal in a greedy manner'''
204+ goal in a greedy manner
205+ """
200206 mov_dir = 'normal'
201207 cand_x , cand_y = - np .inf , - np .inf
202208 if show_animation :
0 commit comments