OddThinking

A blog for odd things and odd thoughts.

Framework Work-out

While I was producing a data model for my new role, I found one of the challenges was massaging old sports data which has been collected over a long period. It was often corrupted or had missing details.

At one point, I was looking at a large number of records that were only partially complete. However, between an understanding of the rules of the sport, and some global data about the collection of records, it was possible to piece together some of the missing data.

As I pondered how to implement such an automated task, it started looking familiar…

I had a set of rules (or constraints), involving how some records affected others. I had some global constraints about the collection of properties. I had some partially filled in information, and I wanted to fill in the rest.

… wait a moment… just like a logic puzzle, like Sudoku, or Nonograms, or Solitaire Battleships…

Don’t I already have a puzzle game framework for such problems?

I was pretty excited! My puzzle game framework was a little piece of re-usable code to speed up a silly hobby; I never intended it to become real code that that helps earn me money. However, I was able to adopt it, unchanged.

I created a new application using the framework, and it was able to fill in all of the recoverable information. It runs very slowly, due to the sheer quantity of the records and the possible combinations (this is a real-world data problem, not a newspaper puzzle), but performance isn’t a issue; once the data is cleaned-up, it stays cleaned up. It is certainly faster than doing it by hand.

Development was much faster that I expected, because the engine was already in place; I just needed to work out the constraint rules, which were fairly clear.

So, yay for the puzzle game framework!


No Comments

  1. No comments yet.
  2. Leave a comment

    You must be logged in to post a comment.