Skip to content

Commit

Permalink
Fixed errors in Vector.random
Browse files Browse the repository at this point in the history
  • Loading branch information
weilycoder committed Oct 5, 2024
1 parent 2727298 commit 52cc6f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cyaron/vector.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ def random(num: int = 5, position_range: list = None, mode: VectorRandomMode = 0

result = []
if mode == VectorRandomMode.repeatable:
result = [[random.randint(x, y) for x, y in zip(offset, length)] for _ in range(num)]
result = [[random.randint(x, x + y) for x, y in zip(offset, length)] for _ in range(num)]
elif mode == VectorRandomMode.float:
result = [[random.uniform(x, y) for x, y in zip(offset, length)] for _ in range(num)]
result = [[random.uniform(x, x + y) for x, y in zip(offset, length)] for _ in range(num)]
elif mode == VectorRandomMode.unique and vector_space > 5 * num:
# O(NlogN)
num_set = set()
Expand Down

0 comments on commit 52cc6f1

Please sign in to comment.