-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGenerateTest.py
More file actions
35 lines (28 loc) · 1.04 KB
/
Copy pathGenerateTest.py
File metadata and controls
35 lines (28 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import random
# DEFINE PARAMETER HERE
CAPACITY = 5000
#NUM_ITEM = [10, 20, 25, 30, 40] # Use this for BF
NUM_ITEM = [50, 100, 200, 500, 1000] # Use this for the others
NUM_CLASS = 5
# RANDOM HERE
for FileParameter in range(0, len(NUM_ITEM)):
filename = "INPUT_" + str(FileParameter) + ".TXT"
file = open(filename, "w")
file.write(str(CAPACITY) + "\n")
file.write(str(NUM_CLASS) +"\n")
num_item = NUM_ITEM[FileParameter]
for i in range(0, num_item):
if (i != num_item - 1):
file.write(str(random.uniform(1, CAPACITY / 2)) + ", ")
else:
file.write(str(random.uniform(1, CAPACITY / 2)) + "\n")
for i in range(0, num_item):
if (i != num_item - 1):
file.write(str(random.randint(1, 100)) + ", ")
else:
file.write(str(random.randint(1, 100)) + "\n")
for i in range(0, num_item):
if (i != num_item - 1):
file.write(str(random.randint(1, NUM_CLASS)) + ", ")
else:
file.write(str(random.randint(1, NUM_CLASS)))