@@ -53,10 +53,12 @@ def mov_to_next_obs(self, visited_x, visited_y):
53
53
return self .r_x [- 1 ], self .r_y [- 1 ], True
54
54
55
55
def bug0 (self ):
56
- '''Greedy algorithm where you move towards goal
56
+ """
57
+ Greedy algorithm where you move towards goal
57
58
until you hit an obstacle. Then you go around it
58
59
(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
+ """
60
62
mov_dir = 'normal'
61
63
cand_x , cand_y = - np .inf , - np .inf
62
64
if show_animation :
@@ -112,12 +114,14 @@ def bug0(self):
112
114
plt .show ()
113
115
114
116
def bug1 (self ):
115
- '''Move towards goal in a greedy manner.
117
+ """
118
+ Move towards goal in a greedy manner.
116
119
When you hit an obstacle, you go around it and
117
120
back to where you hit the obstacle initially.
118
121
Then, you go to the point on the obstacle that is
119
122
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
+ """
121
125
mov_dir = 'normal'
122
126
cand_x , cand_y = - np .inf , - np .inf
123
127
exit_x , exit_y = - np .inf , - np .inf
@@ -187,7 +191,8 @@ def bug1(self):
187
191
plt .show ()
188
192
189
193
def bug2 (self ):
190
- '''Move towards goal in a greedy manner.
194
+ """
195
+ Move towards goal in a greedy manner.
191
196
When you hit an obstacle, you go around it and
192
197
keep track of your distance from the goal.
193
198
If the distance from your goal was decreasing before
@@ -196,7 +201,8 @@ def bug2(self):
196
201
goal (this may or may not be true because the algorithm
197
202
doesn't explore the entire boundary around the obstacle).
198
203
So, you depart from this point and continue towards the
199
- goal in a greedy manner'''
204
+ goal in a greedy manner
205
+ """
200
206
mov_dir = 'normal'
201
207
cand_x , cand_y = - np .inf , - np .inf
202
208
if show_animation :
0 commit comments