Giter Site home page Giter Site logo

chef-scheduler's Introduction

chef-scheduler

My friends and I cook dinner almost every night. One of us cooks a main dish, and someone else cooks a side.

A dynamic scheduling algorithm that takes into account people's differing availability, days that no one is around, and weights to favor people that haven't cooked in a while, is preferrable to signing people up for a consistent day of the week.

Pre-requisites: pip3 install requests

Usage: python3 main.py

Current behavior:

  • Assign nights based on rudimentary weights system. The person who cooked the longest ago is preferred; if unavailable, the next least-recent chef is selected, and so on.
  • The method "find_fair" introduces randomization of the order of chefs in the schedule as presented to the scheduling algorithm. It randomizes the input order, then attempts to find a fair schedule by running the algorithm. If it fails, it tries again.
  • Filters:
    1. The same person cannot cook twice in one day.
    2. Roommates are not assigned the same day.
    3. No chef is assigned to cook two days in a row. By uncommenting the other versions of the roommates and yesterday schedules, conditions 2. and 3. will be allowed, but not unless they are necessary to generate a viable schedule.

REFACTORING PLAN:

  1. Algorithm needs a better way to keep track of the past schedule. Pickle file? Needs easy conversion to json consumable by Adam's service.
  2. User response: confirm/deny suggested schedule, or input manual schedule.
  3. Fairness then becomes a ratio: how many times has this person cooked out of all nights that there were? Is that above or below the desired average?
  4. Support for "x is on vacation for # weeks"; take them out of the schedule and adjust the fairness ratio accordingly. Since they weren't in town to cook that week, "missing" the week shouldn't be a punishment.

Future plans:

  1. (DONE) Don't assign someone both a main and a side on the same day
  2. (DONE) Assign weights
  3. (DONE) Obey limited schedules
  4. (DONE) Test for constraints: no more than 1x per week, no less than 2x in a 3 week period
  5. (DONE) Manually set 'since' variable to add data from previous weeks
  6. (DONE) Add tests for fairness
  7. (DONE) Send SMS via Nexmo API
  8. (DONE) Allow starting algorithm on a Thursday (or any other day)
  9. (DONE) Two cooks that live in the same apartment shouldn’t cook on the same day
  10. Support people being gone on vacation
  11. Send updates to one shared google calendar that everyone can see
  12. (DONE) Attempt to find a fair schedule by randomly shuffling chef entry order until one is found.
  13. (DONE) Use curl instead of nexmo python package in order to use python3
  14. Clean up and separate logic

chef-scheduler's People

Contributors

zjipsen avatar alexanderturinske 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.