Friday, May 3, 2013

Gencon Scheduler Script Update

As it is nearly time for the annual hectic GenCon event scheduling frenzy, I have updated my schedule-planning script.  The latest version of the script is available here.

A stand-alone application version of the program is available here.

This script is a utility I wrote in Python to help in the complex process of searching through the 9000+ individual events in the GenCon event catalog and finding the optimal mix of things to do at the convention.  Like to the Highprogrammer search tool, this script can search through the event catalog and filter events by time, type, organizer, system, age, etc.  Unlike the highprogrammer tool, this script runs completely on your own computer (once it downloads the catalog from the GenCon site) so you don't need to worry about Highprogrammer going down.  But it also does a lot more.

In addition to the event search function, this script also has a schedule optimization mode.  After running a search on the event list and finding an event that interests you, you can add that event to a wish list and assign a priority rank to it.  Once you have gathered a selection of events you might want to attend, the schedule optimization function will run through every possible combination of events to determine the best possible convention schedule for you.  The search tool is also smart enough to recognize that many of the events at GenCon are run at multiple timeslots throughout the weekend.  You simply specify that you'd like to attend an event and the schedule optimizer will pick the best slot for you to attend considering other possible conflicting events.

The script also has a function to guide you through the registration process, filling out your online wishlist with events as determined by your optimal schedule and all the less-optimal schedules yo might fall back on if you don't get tickets to your highest-ranking events.  This function is still somewhat experimental, but does seem to work.

For this year I've vastly improved the code that digests the raw event list files.  It should be a lot more robust to GenCon suddenly deciding to change their catalog format again.  I have also greatly improved the search algorithm, it can now process complex search queries like "Find any pathfinder by paizo on thursday or friday not before noon".  The schedule optimizer also now has a set of user-tweakable rules for things like minimum hours of sleep per night and maximum contiguous hours of gaming without a break.

Now for the downsides.  This is a script, not a stand-alone application.  You will need to download and install Python 2.7 (not 3.x!) for this to run.  The code is not terribly well optimized, some of the functions are quite slow.  Updating the event catalog from the GenCon website in particular takes forever.  The interface is a command-line text interface, there's no GUI or anything friendly like that, but there are some built-in help functions to tell you how to use it.

The first time you run the script, it will automatically connect to the GenCon site and download the event catalog.  At the time of this writing, that catalog does not exist yet, so the script will fail and quit.  I am at the moment assuming that GenCon will be putting this year's event list in the same place as last year's and storing it in a similar format.  If they don't, I'll be updating this script shortly after the catalog becomes available.

Update:  As of the evening of May 8th, the event catalog is live, and my script is successfully downloading and processing it.

4 comments:

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. How does this program decide what order to list the individual events in the GenCon wishlist? Also, is there a way to tell it that I consider "Oriental Chainmail Dice Bag" and "Chainmail Dice Bag" to be the same event?

    ReplyDelete
    Replies
    1. The program determines the order of events for you wishlist by producing a list of all possible schedules you might produce from your chosen events, and assigning a score to each one. The score is based on the summed priority of each event in the schedule, with modifies for time of day (afternoon events preferred over ones early in the morning or very late at night) and time penalties for placing events too close in time to each other. It then goes through the schedules and produces a wishlist which will give you an optimal schedule if you get everything, or the best-possible schedule if you happen to not get into your highest-priority events.

      I have since releasing this version put together a slightly modded version with a few experimental features, including the ability to merge two items on your wish list into a single event. You can download this version here:

      https://www.dropbox.com/s/wz1hqt0v1nud0ji/schedule%20solver%202013%20experimental.py

      There are also a few tweaks to wishlist generation and event searching in this version.

      With this version you can merge two or more events into a single event by adding them separately to your wish list, giving them the same priority number so they'll be grouped together, then using the 'merge' command to merge them. For example, 'merge 4-5' will merge items 4 and 5 on your wish list. The command is a little buggy, it can only join events which are grouped next to each other on your list and will chose the title and description and other data from one of them to describe the whole group, but it does seem to work.

      Delete
    2. Thanks for the info. I wound up getting this year's events in order with Excel (visualizing when the conflicts are), but I'll check in again next year.

      You may want to do some testing around the case when someone adds an event via a specific ID; I tried to add an event that I knew was happening exactly once, and it didn't seem to show up in the solved wishlist. I'd offer to help, but I'm afraid this program is a little algorithm-heavy for my expertise, and I'm pretty terrible at QA.

      Delete