Skip to content

Commit e9f9fc1

Browse files
committed
Approach 4 added
1 parent 51a590f commit e9f9fc1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

mdca_wp_insert.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,17 @@ def run(self, avoidance=True, simul_arr=True):
396396
# const += [ x_n <= 100 ]
397397

398398

399+
''' Approach #4 '''
400+
# if t^i_n < t^j_m
401+
a_nm = di_c/self.v_min - (dj_c-self.d_safe)/self.v_max
402+
403+
# if t^j_m < t^i_n
404+
a_mn = dj_c/self.v_min - (di_c-self.d_safe)/self.v_max
405+
406+
if a_nm >= a_mn:
407+
const += [tj_m1 - ti_n1 + a_mn <= 0]
408+
else:
409+
const += [ti_n1 - tj_m1 + a_nm <= 0]
399410

400411

401412
''' Solve '''

0 commit comments

Comments
 (0)