Initialize seed in macro benchmark generators
Reviewers: dgleich, buda, florijan Reviewed By: dgleich Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D984
This commit is contained in:
parent
e703e955a5
commit
6d78873ace
@ -1,11 +1,15 @@
|
|||||||
import random
|
import random
|
||||||
import common
|
import common
|
||||||
|
|
||||||
|
# Here we set seed to 1, instead of 0, because seed in setup is 0 and we want to
|
||||||
|
# be sure here that we will generate different numbers.
|
||||||
|
random.seed(1)
|
||||||
|
|
||||||
for i in range(common.BFS_ITERS):
|
for i in range(common.BFS_ITERS):
|
||||||
a = int(random.random() * common.VERTEX_COUNT)
|
a = int(random.random() * common.VERTEX_COUNT)
|
||||||
b = int(random.random() * common.VERTEX_COUNT)
|
b = int(random.random() * common.VERTEX_COUNT)
|
||||||
print("MATCH (from: Node {id: %d}) WITH from "
|
print("MATCH (from: Node {id: %d}) WITH from "
|
||||||
"MATCH (to: Node {id: %d}) WITH to "
|
"MATCH (to: Node {id: %d}) WITH to "
|
||||||
"MATCH path = (from)-[*bfs..%d (e, n | true)]->(to) WITH path "
|
"MATCH path = (from)-[*bfs..%d (e, n | true)]->(to) WITH path "
|
||||||
"LIMIT 10 RETURN 0;"
|
"LIMIT 10 RETURN 0;"
|
||||||
% (a, b, common.PATH_LENGTH))
|
% (a, b, common.PATH_LENGTH))
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
import random
|
import random
|
||||||
import common
|
import common
|
||||||
|
|
||||||
|
random.seed(0)
|
||||||
|
|
||||||
for i in range(common.VERTEX_COUNT):
|
for i in range(common.VERTEX_COUNT):
|
||||||
print("CREATE (n: Node {id: %d});" % i)
|
print("CREATE (n: Node {id: %d});" % i)
|
||||||
|
|
||||||
|
@ -1,6 +1,8 @@
|
|||||||
import random
|
import random
|
||||||
import common
|
import common
|
||||||
|
|
||||||
|
random.seed(0)
|
||||||
|
|
||||||
for i in range(common.VERTEX_COUNT * common.QUERIES_PER_VERTEX):
|
for i in range(common.VERTEX_COUNT * common.QUERIES_PER_VERTEX):
|
||||||
a = int(random.random() * common.VERTEX_COUNT)
|
a = int(random.random() * common.VERTEX_COUNT)
|
||||||
b = int(random.random() * common.VERTEX_COUNT)
|
b = int(random.random() * common.VERTEX_COUNT)
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
""" This file does nothing, it's just utilities for other setups """
|
""" This file does nothing, it's just utilities for other setups """
|
||||||
|
|
||||||
from random import randint
|
from random import randint, seed
|
||||||
|
|
||||||
|
|
||||||
BATCH_SIZE = 100
|
BATCH_SIZE = 100
|
||||||
|
seed(0)
|
||||||
|
|
||||||
|
|
||||||
def create_vertices(vertex_count):
|
def create_vertices(vertex_count):
|
||||||
|
@ -2,9 +2,11 @@
|
|||||||
Generates a random graph with some configurable statistics.
|
Generates a random graph with some configurable statistics.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
from random import randint
|
from random import randint, seed
|
||||||
|
|
||||||
|
|
||||||
|
seed(0)
|
||||||
|
|
||||||
def rint(upper_bound_exclusive):
|
def rint(upper_bound_exclusive):
|
||||||
return randint(0, upper_bound_exclusive - 1)
|
return randint(0, upper_bound_exclusive - 1)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user