succesfull testing

This commit is contained in:
Talhadeveloperr
2026-09-09 18:55:53 +05:00
parent 868bcbe175
commit 9079ba2739
268 changed files with 2284 additions and 1495 deletions

View File

@@ -3,8 +3,10 @@ A-101,Room 101,A,classroom,60
A-102,Room 102,A,classroom,60
A-103,Room 103,A,classroom,50
A-201,Room 201,A,classroom,60
A-202,Room 202,A,classroom,60
A-L01,Computer Lab 1,A,lab,35
A-L02,Computer Lab 2,A,lab,35
A-L03,Computer Lab 3,A,lab,35
B-101,Room 101 (B),B,classroom,50
B-102,Room 102 (B),B,classroom,50
B-L01,Electronics Lab,B,lab,30
1 room_id room_name block_id room_type capacity
3 A-102 Room 102 A classroom 60
4 A-103 Room 103 A classroom 50
5 A-201 Room 201 A classroom 60
6 A-202 Room 202 A classroom 60
7 A-L01 Computer Lab 1 A lab 35
8 A-L02 Computer Lab 2 A lab 35
9 A-L03 Computer Lab 3 A lab 35
10 B-101 Room 101 (B) B classroom 50
11 B-102 Room 102 (B) B classroom 50
12 B-L01 Electronics Lab B lab 30

View File

@@ -2,43 +2,43 @@ course_id,section_id,batch_codes,instructor_code
CS101,A,25021519,1001
CS201,A,25021519,1002
CS301,A,25021519,1003
CS302,A,25021519,1001
CS302,A,25021519,1009
CS101,B,25021520,1001
CS201,B,25021520,1002
CS301,B,25021520,1003
CS302,B,25021520,1001
CS302,B,25021520,1012
EE101,A,25031519,1004
EE201,A,25031519,1005
EE301,A,25031519,1004
EE301,A,25031519,1010
EE101,B,25031520,1004
EE201,B,25031520,1005
EE301,B,25031520,1004
EE301,B,25031520,1010
BBA101,A,25041519,1007
BBA201,A,25041519,1008
BBA301,A,25041519,1007
BBA301,A,25041519,1011
BBA101,B,25041520,1007
BBA201,B,25041520,1008
BBA301,B,25041520,1007
BBA301,B,25041520,1011
CS101,C,26021519,1001
CS201,C,26021519,1002
CS301,C,26021519,1003
CS302,C,26021519,1001
CS302,C,26021519,1009
CS101,D,26021520,1001
CS201,D,26021520,1002
CS301,D,26021520,1003
CS302,D,26021520,1001
CS302,D,26021520,1012
EE101,C,26031519,1004
EE201,C,26031519,1005
EE301,C,26031519,1004
EE301,C,26031519,1010
EE101,D,26031520,1004
EE201,D,26031520,1005
EE301,D,26031520,1004
EE301,D,26031520,1010
BBA101,C,26041519,1007
BBA201,C,26041519,1008
BBA301,C,26041519,1007
BBA301,C,26041519,1011
BBA101,D,26041520,1007
BBA201,D,26041520,1008
BBA301,D,26041520,1007
BBA301,D,26041520,1011
GEN101,ALL,25021519|25021520|25031519|25031520|25041519|25041520,1002
GEN102,ALL,25021519|25021520|25031519|25031520|25041519|25041520,1006
GEN103,ALL,25021519|25021520|25031519|25031520|25041519|25041520,1006
1 course_id section_id batch_codes instructor_code
2 CS101 A 25021519 1001
3 CS201 A 25021519 1002
4 CS301 A 25021519 1003
5 CS302 A 25021519 1001 1009
6 CS101 B 25021520 1001
7 CS201 B 25021520 1002
8 CS301 B 25021520 1003
9 CS302 B 25021520 1001 1012
10 EE101 A 25031519 1004
11 EE201 A 25031519 1005
12 EE301 A 25031519 1004 1010
13 EE101 B 25031520 1004
14 EE201 B 25031520 1005
15 EE301 B 25031520 1004 1010
16 BBA101 A 25041519 1007
17 BBA201 A 25041519 1008
18 BBA301 A 25041519 1007 1011
19 BBA101 B 25041520 1007
20 BBA201 B 25041520 1008
21 BBA301 B 25041520 1007 1011
22 CS101 C 26021519 1001
23 CS201 C 26021519 1002
24 CS301 C 26021519 1003
25 CS302 C 26021519 1001 1009
26 CS101 D 26021520 1001
27 CS201 D 26021520 1002
28 CS301 D 26021520 1003
29 CS302 D 26021520 1001 1012
30 EE101 C 26031519 1004
31 EE201 C 26031519 1005
32 EE301 C 26031519 1004 1010
33 EE101 D 26031520 1004
34 EE201 D 26031520 1005
35 EE301 D 26031520 1004 1010
36 BBA101 C 26041519 1007
37 BBA201 C 26041519 1008
38 BBA301 C 26041519 1007 1011
39 BBA101 D 26041520 1007
40 BBA201 D 26041520 1008
41 BBA301 D 26041520 1007 1011
42 GEN101 ALL 25021519|25021520|25031519|25031520|25041519|25041520 1002
43 GEN102 ALL 25021519|25021520|25031519|25031520|25041519|25041520 1006
44 GEN103 ALL 25021519|25021520|25031519|25031520|25041519|25041520 1006

View File

@@ -1,8 +1,8 @@
course_id,course_name,credit_hours,lectures_per_week,labs_per_week,is_general,lecture_room_id,lab_room_id,lecture_duration_minutes
CS101,Programming Fundamentals,4,2,1,no,A-101,A-L01,90
CS201,Data Structures,4,2,1,no,A-102,A-L01,90
CS301,Operating Systems,3,1,1,no,A-101,A-L02,120
CS302,Database Systems,4,2,2,no,A-102,A-L02,90
CS201,Data Structures,4,2,1,no,A-102,A-L02,90
CS301,Operating Systems,3,1,1,no,A-101,A-L03,120
CS302,Database Systems,4,2,1,no,A-102,A-L01,90
EE101,Basic Electronics,4,2,1,no,A-201,A-L02,90
EE201,Digital Logic Design,4,2,1,no,B-101,B-L01,90
EE301,Signals and Systems,3,1,0,no,B-102,,120
@@ -11,4 +11,4 @@ BBA201,Financial Accounting,3,2,0,no,B-102,,90
BBA301,Marketing Management,3,1,0,no,A-103,,120
GEN101,Functional English,3,2,0,yes,A-103,,90
GEN102,Islamic Studies,2,1,0,yes,A-103,,90
GEN103,Pakistan Studies,2,1,0,yes,B-101,,120
GEN103,Pakistan Studies,2,1,0,yes,A-202,,120
1 course_id course_name credit_hours lectures_per_week labs_per_week is_general lecture_room_id lab_room_id lecture_duration_minutes
2 CS101 Programming Fundamentals 4 2 1 no A-101 A-L01 90
3 CS201 Data Structures 4 2 1 no A-102 A-L01 A-L02 90
4 CS301 Operating Systems 3 1 1 no A-101 A-L02 A-L03 120
5 CS302 Database Systems 4 2 2 1 no A-102 A-L02 A-L01 90
6 EE101 Basic Electronics 4 2 1 no A-201 A-L02 90
7 EE201 Digital Logic Design 4 2 1 no B-101 B-L01 90
8 EE301 Signals and Systems 3 1 0 no B-102 120
11 BBA301 Marketing Management 3 1 0 no A-103 120
12 GEN101 Functional English 3 2 0 yes A-103 90
13 GEN102 Islamic Studies 2 1 0 yes A-103 90
14 GEN103 Pakistan Studies 2 1 0 yes B-101 A-202 120

View File

@@ -38,8 +38,9 @@ def main():
],
)
# ---- rooms: deliberately tight relative to demand (see offerings
# below) so room contention is real, spread across both blocks ----
# ---- rooms: tight enough to keep real contention, but with enough
# total capacity that a correct solver can always find a fit (room
# capacity/student-count is not a constraint here) ----
write_csv(
"blocks/rooms.csv",
["room_id", "room_name", "block_id", "room_type", "capacity"],
@@ -48,8 +49,10 @@ def main():
["A-102", "Room 102", "A", "classroom", 60],
["A-103", "Room 103", "A", "classroom", 50],
["A-201", "Room 201", "A", "classroom", 60],
["A-202", "Room 202", "A", "classroom", 60],
["A-L01", "Computer Lab 1", "A", "lab", 35],
["A-L02", "Computer Lab 2", "A", "lab", 35],
["A-L03", "Computer Lab 3", "A", "lab", 35],
["B-101", "Room 101 (B)", "B", "classroom", 50],
["B-102", "Room 102 (B)", "B", "classroom", 50],
["B-L01", "Electronics Lab", "B", "lab", 30],
@@ -97,15 +100,18 @@ def main():
#
# Mixed lecture durations: most courses are 90-min x N/week, but a few
# are the special "2 hours once a week" case (lecture_duration_minutes
# 120, lectures_per_week 1). Labs vary 0/1/2 per week. Deliberately
# more courses per department than the room/instructor pool can
# comfortably absorb without contention.
# 120, lectures_per_week 1). A course's lab, if it has one, is always
# exactly once a week (180 minutes) — never more. Deliberately more
# courses per department than the room/instructor pool can comfortably
# absorb without contention.
courses = [
# CS department courses
# CS department courses — lab rooms spread across A-L01/A-L02/A-L03
# so no single lab room is asked for more sessions than exist
# weekly slots for it (5 days x 2 lab-slot-pairs = 10/week).
["CS101", "Programming Fundamentals", 4, 2, 1, "no", "A-101", "A-L01", 90],
["CS201", "Data Structures", 4, 2, 1, "no", "A-102", "A-L01", 90],
["CS301", "Operating Systems", 3, 1, 1, "no", "A-101", "A-L02", 120],
["CS302", "Database Systems", 4, 2, 2, "no", "A-102", "A-L02", 90],
["CS201", "Data Structures", 4, 2, 1, "no", "A-102", "A-L02", 90],
["CS301", "Operating Systems", 3, 1, 1, "no", "A-101", "A-L03", 120],
["CS302", "Database Systems", 4, 2, 1, "no", "A-102", "A-L01", 90],
# EE department courses
["EE101", "Basic Electronics", 4, 2, 1, "no", "A-201", "A-L02", 90],
["EE201", "Digital Logic Design", 4, 2, 1, "no", "B-101", "B-L01", 90],
@@ -117,7 +123,7 @@ def main():
# General (shared) courses
["GEN101", "Functional English", 3, 2, 0, "yes", "A-103", "", 90],
["GEN102", "Islamic Studies", 2, 1, 0, "yes", "A-103", "", 90],
["GEN103", "Pakistan Studies", 2, 1, 0, "yes", "B-101", "", 120],
["GEN103", "Pakistan Studies", 2, 1, 0, "yes", "A-202", "", 120],
]
write_csv(
"courses/courses.csv",
@@ -139,27 +145,47 @@ def main():
"EE": ["EE101", "EE201", "EE301"],
"BBA": ["BBA101", "BBA201", "BBA301"],
}
# Small pools relative to (department batches x courses) demand.
# One instructor per course within a department (so no instructor ever
# teaches two different courses to the same section/batch, which would
# double their weekly slot demand against that batch's narrow shared
# availability) — still a tight pool overall since each instructor
# teaches their course across every section of the department.
dept_instructors = {
"CS": ["1001", "1002", "1003"],
"EE": ["1004", "1005"],
"BBA": ["1007", "1008"],
"CS": ["1001", "1002", "1003", "1009"],
"EE": ["1004", "1005", "1010"],
"BBA": ["1007", "1008", "1011"],
}
# CS302 additionally alternates between two instructors across its
# sections (instead of one instructor owning all 4) since it has the
# heaviest per-section load (2 lectures + 2 labs/week) — one person
# covering every section of it would need more slot-0 room than a
# single instructor realistically has once other batches' commitments
# are accounted for.
course_instructor_rotation = {"CS302": ["1009", "1012"]}
instructor_names_extra = {"1012": "Ms. Rabia Nasir"}
offerings = []
section_letters = ["A", "B", "C", "D"]
dept_section_counter = {"CS": 0, "EE": 0, "BBA": 0}
for batch_code, department, program, session in all_batches:
section_id = section_letters[dept_section_counter[department] % len(section_letters)]
section_index = dept_section_counter[department]
section_id = section_letters[section_index % len(section_letters)]
dept_section_counter[department] += 1
instr_pool = dept_instructors[department]
# One instructor per course, consistent across every section, so
# no instructor ever teaches two different courses to the same
# batch (which would silently double their contested slot-0
# demand against that one batch). The pool is still tight overall
# since each instructor teaches their course to every section of
# the department -> real instructor contention across sections.
for i, course_id in enumerate(dept_courses[department]):
# Deliberately narrow instructor rotation (2-3 instructors
# covering 3-4 courses per department) so the same instructor
# teaches multiple courses/sections -> instructor contention.
instr = instr_pool[i % len(instr_pool)]
if course_id in course_instructor_rotation:
rotation = course_instructor_rotation[course_id]
instr = rotation[section_index % len(rotation)]
else:
instr = instr_pool[i % len(instr_pool)]
offerings.append([course_id, section_id, batch_code, instr])
# general courses: one offering per (course, session), section "ALL"
@@ -190,6 +216,10 @@ def main():
"1006": "Ms. Hira Shah",
"1007": "Dr. Nadia Farooq",
"1008": "Mr. Kamran Sheikh",
"1009": "Ms. Ayesha Malik",
"1010": "Mr. Imran Qureshi",
"1011": "Dr. Saima Aziz",
**instructor_names_extra,
}
instructors = []
for course_id, section_id, batch_codes, instr_code in offerings:

View File

@@ -2,43 +2,43 @@ instructor_code,instructor_name,course_id,section_id
1001,Dr. Ahsan Raza,CS101,A
1002,Ms. Sana Tariq,CS201,A
1003,Mr. Bilal Khan,CS301,A
1001,Dr. Ahsan Raza,CS302,A
1009,Ms. Ayesha Malik,CS302,A
1001,Dr. Ahsan Raza,CS101,B
1002,Ms. Sana Tariq,CS201,B
1003,Mr. Bilal Khan,CS301,B
1001,Dr. Ahsan Raza,CS302,B
1012,Ms. Rabia Nasir,CS302,B
1004,Dr. Farah Iqbal,EE101,A
1005,Mr. Usman Ali,EE201,A
1004,Dr. Farah Iqbal,EE301,A
1010,Mr. Imran Qureshi,EE301,A
1004,Dr. Farah Iqbal,EE101,B
1005,Mr. Usman Ali,EE201,B
1004,Dr. Farah Iqbal,EE301,B
1010,Mr. Imran Qureshi,EE301,B
1007,Dr. Nadia Farooq,BBA101,A
1008,Mr. Kamran Sheikh,BBA201,A
1007,Dr. Nadia Farooq,BBA301,A
1011,Dr. Saima Aziz,BBA301,A
1007,Dr. Nadia Farooq,BBA101,B
1008,Mr. Kamran Sheikh,BBA201,B
1007,Dr. Nadia Farooq,BBA301,B
1011,Dr. Saima Aziz,BBA301,B
1001,Dr. Ahsan Raza,CS101,C
1002,Ms. Sana Tariq,CS201,C
1003,Mr. Bilal Khan,CS301,C
1001,Dr. Ahsan Raza,CS302,C
1009,Ms. Ayesha Malik,CS302,C
1001,Dr. Ahsan Raza,CS101,D
1002,Ms. Sana Tariq,CS201,D
1003,Mr. Bilal Khan,CS301,D
1001,Dr. Ahsan Raza,CS302,D
1012,Ms. Rabia Nasir,CS302,D
1004,Dr. Farah Iqbal,EE101,C
1005,Mr. Usman Ali,EE201,C
1004,Dr. Farah Iqbal,EE301,C
1010,Mr. Imran Qureshi,EE301,C
1004,Dr. Farah Iqbal,EE101,D
1005,Mr. Usman Ali,EE201,D
1004,Dr. Farah Iqbal,EE301,D
1010,Mr. Imran Qureshi,EE301,D
1007,Dr. Nadia Farooq,BBA101,C
1008,Mr. Kamran Sheikh,BBA201,C
1007,Dr. Nadia Farooq,BBA301,C
1011,Dr. Saima Aziz,BBA301,C
1007,Dr. Nadia Farooq,BBA101,D
1008,Mr. Kamran Sheikh,BBA201,D
1007,Dr. Nadia Farooq,BBA301,D
1011,Dr. Saima Aziz,BBA301,D
1002,Ms. Sana Tariq,GEN101,ALL
1006,Ms. Hira Shah,GEN102,ALL
1006,Ms. Hira Shah,GEN103,ALL
1 instructor_code instructor_name course_id section_id
2 1001 Dr. Ahsan Raza CS101 A
3 1002 Ms. Sana Tariq CS201 A
4 1003 Mr. Bilal Khan CS301 A
5 1001 1009 Dr. Ahsan Raza Ms. Ayesha Malik CS302 A
6 1001 Dr. Ahsan Raza CS101 B
7 1002 Ms. Sana Tariq CS201 B
8 1003 Mr. Bilal Khan CS301 B
9 1001 1012 Dr. Ahsan Raza Ms. Rabia Nasir CS302 B
10 1004 Dr. Farah Iqbal EE101 A
11 1005 Mr. Usman Ali EE201 A
12 1004 1010 Dr. Farah Iqbal Mr. Imran Qureshi EE301 A
13 1004 Dr. Farah Iqbal EE101 B
14 1005 Mr. Usman Ali EE201 B
15 1004 1010 Dr. Farah Iqbal Mr. Imran Qureshi EE301 B
16 1007 Dr. Nadia Farooq BBA101 A
17 1008 Mr. Kamran Sheikh BBA201 A
18 1007 1011 Dr. Nadia Farooq Dr. Saima Aziz BBA301 A
19 1007 Dr. Nadia Farooq BBA101 B
20 1008 Mr. Kamran Sheikh BBA201 B
21 1007 1011 Dr. Nadia Farooq Dr. Saima Aziz BBA301 B
22 1001 Dr. Ahsan Raza CS101 C
23 1002 Ms. Sana Tariq CS201 C
24 1003 Mr. Bilal Khan CS301 C
25 1001 1009 Dr. Ahsan Raza Ms. Ayesha Malik CS302 C
26 1001 Dr. Ahsan Raza CS101 D
27 1002 Ms. Sana Tariq CS201 D
28 1003 Mr. Bilal Khan CS301 D
29 1001 1012 Dr. Ahsan Raza Ms. Rabia Nasir CS302 D
30 1004 Dr. Farah Iqbal EE101 C
31 1005 Mr. Usman Ali EE201 C
32 1004 1010 Dr. Farah Iqbal Mr. Imran Qureshi EE301 C
33 1004 Dr. Farah Iqbal EE101 D
34 1005 Mr. Usman Ali EE201 D
35 1004 1010 Dr. Farah Iqbal Mr. Imran Qureshi EE301 D
36 1007 Dr. Nadia Farooq BBA101 C
37 1008 Mr. Kamran Sheikh BBA201 C
38 1007 1011 Dr. Nadia Farooq Dr. Saima Aziz BBA301 C
39 1007 Dr. Nadia Farooq BBA101 D
40 1008 Mr. Kamran Sheikh BBA201 D
41 1007 1011 Dr. Nadia Farooq Dr. Saima Aziz BBA301 D
42 1002 Ms. Sana Tariq GEN101 ALL
43 1006 Ms. Hira Shah GEN102 ALL
44 1006 Ms. Hira Shah GEN103 ALL