-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtestData.py
36 lines (25 loc) · 932 Bytes
/
testData.py
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
36
import random
from random import sample, randint
from classes.course import Course
from classes.participant import Participant
def generateTestData():
number_of_courses = random.randint(18, 25)
number_participants = 270
courseNumberList = [i for i in range(1, number_of_courses + 1)]
participants = []
for i in range(1, number_participants + 1):
participants.append(
Participant(i, i, f"Participant {i}", sample(courseNumberList, 3))
)
courses = []
for courseID in courseNumberList:
courses.append(
Course(courseID, courses, f"course {courseID}", randint(6, 20), randint(4, 5))
)
sum = 0
for course in courses:
sum += course.max_participants
print(f"number_participants {number_participants}")
print(f"number_of_courses {number_of_courses}")
print(f"places in courses {sum}")
return participants, courses