-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestNeuralNetwork.py
More file actions
59 lines (54 loc) · 2.33 KB
/
Copy pathtestNeuralNetwork.py
File metadata and controls
59 lines (54 loc) · 2.33 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import random
class Student:
def __init__(self, name, friends, random_students=None):
self.name = name
self.friends = friends
self.random_students = random_students if random_students else []
# Initial list of students with friends
students = [
Student('Alice', ['Bob', 'Charlie', 'David']),
Student('Bob', ['Alice']),
Student('Charlie', ['Alice', 'Uma', 'Chloe']),
Student('David', ['Alice', 'Bob', 'Charlie']),
Student('Eve', ['Frank', 'Grace', 'Hannah', 'Ivy']),
Student('Frank', ['Alice', 'Bob', 'Tina', 'Jack']),
Student('Grace', ['Charlie']),
Student('Hannah', ['Jack', 'Uma', 'Chloe', 'Harry']),
Student('Ivy', ['Charlie']),
Student('Jack', ['Bob', 'Alice', 'David']),
Student('Kate', ['Frank', 'Leo', 'Gina']),
Student('Leo', ['Isla', 'Jack', 'Frank', 'Ivy']),
Student('Mia', ['Ruby', 'Uma']),
Student('Nina', ['Bob']),
Student('Oscar', ['Violet']),
Student('Paul', ['Grace']),
Student('Quinn', ['Tina']),
Student('Ruby', ['Hannah', 'Grace', 'Kate']),
Student('Sam', ['Tina', 'Gina', 'Paul', 'Kate']),
Student('Tina', ['Yara', 'Harry']),
Student('Uma', ['Alice']),
Student('Violet', ['Uma', 'Oscar']),
Student('Will', ['Gina', 'Eve', 'Quinn', 'Alice']),
Student('Xander', ['Gina', 'Ruby']),
Student('Yara', ['Ben', 'Hannah']),
Student('Zack', ['Nina', 'Paul', 'Frank']),
Student('Ava', ['Paul', 'Sam', 'Oscar', 'Xander']),
Student('Ben', ['Ava', 'Harry', 'Nina', 'Xander']),
Student('Chloe', ['Sam', 'Ben']),
Student('Dylan', ['Hannah', 'Bob']),
Student('Ellie', ['Quinn', 'Alice', 'Tina']),
Student('Finn', ['Mia', 'Jack', 'Ellie', 'Chloe']),
Student('Gina', ['Nina', 'Tina', 'Jack']),
Student('Harry', ['Sam', 'Nina']),
Student('Isla', ['Ava', 'David', 'Violet']),
Student('Erick', ['Ben', 'Xander'])
]
# Adding random students to around a third of the students
num_students = len(students)
students_to_update = random.sample(students, num_students // 3)
for student in students_to_update:
random_students = random.sample(students, random.randint(1, 2))
student.random_students = [s.name for s in random_students if s.name != student.name]
# Checking the updated list of students
for student in students:
print(f"Student('{student.name}', {student.friends}, {student.random_students}),")