Skip to content

Commit 368a1c5

Browse files
author
Geniucker
committed
perf: minor update for random path
1 parent 29a861e commit 368a1c5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tools/run.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,9 @@ def run(loc: list, v, d=15):
8686
import time
8787
random.seed(time.time())
8888
while True:
89-
newLoc = randLoc(loc, n=7)
89+
nList = (5, 7, 9)
90+
n = nList[random.randint(0, len(nList)-1)]
91+
newLoc = randLoc(loc, n=n) # a path will be divided into n parts for random route
9092
vRand = 1000/(1000/v-(2*random.random()-1)*d)
9193
run1(newLoc, vRand)
9294
print("跑完一圈了")

0 commit comments

Comments
 (0)