Skip to content

Latest commit

 

History

History
141 lines (116 loc) · 4.17 KB

README.adoc

File metadata and controls

141 lines (116 loc) · 4.17 KB

School timetabling

Binder

Assign lessons to timeslots and rooms to produce a better schedule for teachers and students.

school timetabling screenshot

Requirements

Run the application

  1. Git clone the optapy-quickstarts repo and navigate to this directory:

    $ git clone https://github.com/optapy/optapy-quickstarts.git
    $ cd optapy-quickstarts/school-timetabling
  2. Activate a virtual environment

    $ python -m venv venv
    $ . venv/bin/activate
  3. Install the quickstart requirements to the virtual environment

    $ pip install -r requirements.txt
  4. Run the application

    $ python main.py

OptaPy will begin solving the schedule and print it when finished:

|------------|------------|------------|------------|
|            | Room A     | Room B     | Room C     |
|------------|------------|------------|------------|
| MON 08:30: |            | Math       | History    |
|            |            | A. Turing  | I. Jones   |
|            |            | 9th grade  | 10th grade |
|------------|------------|------------|------------|
| MON 09:30: |            | Math       | History    |
|            |            | A. Turing  | I. Jones   |
|            |            | 10th grade | 9th grade  |
|------------|------------|------------|------------|
| MON 10:30: |            | Math       | English    |
|            |            | A. Turing  | I. Jones   |
|            |            | 10th grade | 9th grade  |
|------------|------------|------------|------------|
| MON 13:30: | Math       | Spanish    |            |
|            | A. Turing  | P. Cruz    |            |
|            | 10th grade | 9th grade  |            |
|------------|------------|------------|------------|
| MON 14:30: | Math       | English    |            |
|            | A. Turing  | P. Cruz    |            |
|            | 9th grade  | 10th grade |            |
|------------|------------|------------|------------|
| TUE 08:30: | Physics    | Spanish    |            |
|            | M. Curie   | P. Cruz    |            |
|            | 9th grade  | 10th grade |            |
|------------|------------|------------|------------|
| TUE 09:30: | Chemistry  |            | English    |
|            | M. Curie   |            | I. Jones   |
|            | 10th grade |            | 9th grade  |
|------------|------------|------------|------------|
| TUE 10:30: | Physics    | Spanish    |            |
|            | M. Curie   | P. Cruz    |            |
|            | 10th grade | 9th grade  |            |
|------------|------------|------------|------------|
| TUE 13:30: | French     |            | Biology    |
|            | M. Curie   |            | C. Darwin  |
|            | 10th grade |            | 9th grade  |
|------------|------------|------------|------------|
| TUE 14:30: | Chemistry  | Geography  |            |
|            | M. Curie   | C. Darwin  |            |
|            | 9th grade  | 10th grade |            |
|------------|------------|------------|------------|

Run the tests

  1. Git clone the optapy-quickstarts repo and navigate to this directory:

    $ git clone https://github.com/optapy/optapy-quickstarts.git
    $ cd optapy-quickstarts/school-timetabling
  2. Activate a virtual environment

    $ python -m venv venv
    $ . venv/bin/activate
  3. Install the quickstart requirements and a testing framework to the virtual environment

    $ pip install -r requirements.txt pytest
  4. Run the tests

    $ python -m pytest tests.py

More information