Обновить wrapper.py
This commit is contained in:
@@ -22,5 +22,12 @@ if __name__=='__main__':
|
|||||||
user_position.append(val_output['coordinates']['lon'])
|
user_position.append(val_output['coordinates']['lon'])
|
||||||
else:
|
else:
|
||||||
print('Адрес не найден')
|
print('Адрес не найден')
|
||||||
route = build_route(found_points, mapping,user_position,user_time,5)
|
n_nodes = len(mapping)
|
||||||
|
allow_extend = any(v[1] for v in mapping.values())
|
||||||
|
print(len(mapping),allow_extend)
|
||||||
|
route =0
|
||||||
|
if allow_extend:
|
||||||
|
while n_nodes <= 5 and (route := build_route(found_points, mapping, user_position, user_time, n_nodes,strategy='random') or route): n_nodes += 1
|
||||||
|
else:
|
||||||
|
route= build_route(found_points, mapping, user_position, user_time, n_nodes,strategy='random')
|
||||||
print(route)
|
print(route)
|
||||||
Reference in New Issue
Block a user