Skip to content
This repository has been archived by the owner on Aug 30, 2020. It is now read-only.

antoninkriz/CTU-TimeTableGenerator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This project is deprecated in favor of the CTU-TimeTableGenerator-new

CTU-TimeTableGenerator

Generates the best possible time table

What can it do?

The program generates all possible time tables for given classes and ranks them based from the best (lowest amount of time spent in school) to the worst following these rules:

  • No. of "standard classes hours" from the first one to the last one in a day, times 10
  • Free day = -20 points
  • Day only with one lecture = -10 points
  • Day with lectures only = -5 points
  • NO_730 = +5 points when the first class starts at 7:30
  • NO_915 = +1 point when the first class starts at 9:15

Parameters NO_730 and NO_915 can be enabled/disabled in the code. Please support the 730ne.cz petition.

What is NOT supported

  • time table is generated only for 7 days, not taking in count another week
  • only standard class times are supported (exception for BI-CS1, see time_to_index or timeToIndex functions)
  • and probably much, much more

How to use

Spoof HTTP requests to https://timetable.fit.cvut.cz/new/api/sirius/courses/CLASS_NAME/events?... from timetable.fit.cvut.cz Using Chrome Dev tools and copy paste them to the rozvrh.json file following this structure:

{
    "FI-KSA": {"events":[...]},
    "BI-LIN": <copy pasted response from timetables>,
    ...
}

Python

Place file rozvrh.json into same folder where's the script and run it. It's slow for bigger input. Very slow - around 90 minutes minutes with complete data. Be aware.

C++

Compile with g++ -O3 --std=c++17 main.cpp and pipe the input file to stdin of the program using cat rozvrh.json | ./a.out. This one is actually fast, using the same algorithm.

Warning

Keep your eye on your RAM while this code runs. This is NP-hard problem and can take shitlaod a lot of RAM to complete. A lot means even 10 GB. Take that in mind.

I am very generous and I want to help

Don't be afraid to create an issue or a pull request!