Skip to content
A tool to schedule OCA fixtures
Python Jupyter Notebook
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
ocafix.ipynb
ocafix.py
printlist.py
typicalOutput.txt

README.md

ocafix

Introduction

ocafix is a tool to schedule OCA fixtures. After the initial parameters are defined, it then performs Monte-Carlo simulations until it finds a fixture list that meets the constraints. The fixtures are then written to stdout. A python pickle file (fixtures.pickle) is also created so that further analysis can be undertaken.

The code is written in Python3 and uses standard libraries.

Running Instructions

On a local machine

Check out this repository and change directory to its contents, Then run

                          python3 ocafix.py  N

where N is the number of simulations to be evaluated.

In a web browser

Go to https://mybinder.org/v2/gh/DavidWRobson/ocafix/master

Click on the ocafix.ipynb link

Click on the area saying "run -i 'ocafix.py'" This will make sure it is highlighted (there will be a coloured line on the side), and then just click "Run" The numerical argument is the number of simulations to be evaluated.

Current constraints

  1. Fixtures lie with the two halves of the season
  2. Fixtures occur on the club night of the home team
  3. Fixtures are only between teams in the same division
  4. Teams in the same division play each other twice; once at home and once away
  5. Teams do not play each other twice during the same half of the season
  6. Teams from the same club play each other at the beginning of the season halves
  7. No team plays more than one match in the same week (except for the University)
  8. No fixtures scheduled for the day after Kidlington
  9. No fixtures scheduled for the day after The Witney Congress
  10. No fixtures scheduled for Easter Bank Holiday
  11. No fixtures scheduled for the day of the Peter Wells' simultaneous event
  12. No fixtures scheduled for the day of the Cowley Blitz
  13. Fixtures between teams from the same club are scheduled at the begining of each half of the season
  14. No matches to be scheduled outside ranges specified for clubs. Currently Abingdon School terms and University terms, excluding Michaelmas 1st week for initial preparation and Trinity 5th to 8th week for exams.
  15. Clubs do not have more than a specified number of fixtures at home on the same day (currently 2 for all clubs)
  16. Cowley does not have more than 1 fixtures at home on the third Monday of the month to avoid clash with Stamp Club.
  17. The number of teams that have adjacent teams playing on the same night is minimized.
  18. The number of times both Bicester teams play at home on the same night is maximize
  19. Cowley Didcot and Witney teams don't have "adjacent" (e.g. Team N and Team N+1) playing on the same night.
  20. The Banbury teams are excluded from playing on the 84! nights in which there are clashes with the Leamington and Warwick leagues,.

Conversion to a Windows executable

The python program can be built as a standalone windows executable by running the following steps on a Windows machine. Tested on a Windows 10 machine, will probably work on other versions, also Linux and Mac.

  1. Install PyInstaller with "pip install PyInstaller"
  2. Convert with pyinstaller.exe -F ocafix.py (builds ocafix.exe in dist folder)
  3. Run with ".\dist\ocafix\ocafix.exe"
You can’t perform that action at this time.