Giter VIP home page Giter VIP logo

schedule-helper's Introduction

Schedule helper (in progress)


This application implements a variation of the Gale-Shapley algorithm to create stable schedules for teachers and auditoriums. Teachers prioritize their preferred time slots, while auditoriums aim for optimal occupancy based on group sizes.

try it here app

Explanation:

  • Stable Matching: This application finds a stable matching between teachers' preferences and auditoriums' availability and capacity constraints. Teacher Preferences: Teachers prioritize convenient time slots.
  • Auditorium Preferences:
  • Auditoriums prefer being fully occupied and give preference to groups that match their capacity (small, medium, or large).
def calculate_preferences(cls, capacity):
    match capacity:
        case capacity if capacity <= 10:
            return {
                SizeCategory.SMALL: Preference.HIGH,
                SizeCategory.MEDIUM: Preference.MEDIUM,
                SizeCategory.LARGE: Preference.LOW,
            }
        case capacity if capacity <= 20:
            return {
                SizeCategory.SMALL: Preference.LOW,
                SizeCategory.MEDIUM: Preference.HIGH,
                SizeCategory.LARGE: Preference.MEDIUM,
            }
        case _:  # Default case for capacity > 20
            return {
                SizeCategory.SMALL: Preference.LOW,
                SizeCategory.MEDIUM: Preference.MEDIUM,
                SizeCategory.LARGE: Preference.HIGH,
            }

the rest of preferences might be diffrent depends on univeriyt intresrest I made it like SizeCategory.SMALL: Preference.LOW for medium and big auditorims becouse it is difficult for students to find a sit.


Lets look close to the code bellow:

def get_teacher_preference_score(teacher, auditorium):
    # Prioritize time match, with some consideration for matching capacity size
    time_score = 3 if teacher.time_preference == auditorium.time_slot.start_time else 1
    size_score = 1 if teacher.group.size_category == auditorium.size_category else 0.5
    return time_score + size_score

If a teacher's time_preference aligns perfectly with an auditorium's time_slot, it assigns a high score (time_score = 3). This indicates that time is a significant factor in determining a teacher's preference.

If a teacher's group.size_category matches the auditorium.size_category, it assigns a moderate score (size_score = 1). Otherwise, it assigns a slightly lower score (size_score = 0.5)

The function adds the time_score and size_score to give a final preference score. This combined score helps the algorithm rank auditoriums in order of desirability for each teacher.


Additional notes:

  • Prioritizing Full Auditoriums: An auditorium will always try to accommodate a teacher if it has space, ensuring optimal usage of resources.

Backlog:

  • Time Preferences for Auditoriums: Implement a feature for auditoriums to specify preferred time slots.
  • Needs test with a bigger data

schedule-helper's People

Contributors

pakhomovskii avatar

Stargazers

dzmitry-lahoda avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.