succesfull testing
This commit is contained in:
@@ -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
|
||||
|
||||
|
@@ -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,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
|
||||
|
||||
|
@@ -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:
|
||||
|
||||
@@ -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
|
||||
|
||||
|
Reference in New Issue
Block a user