[QUIZ][SOLUTION] Pinewood Derby Chart (#56)

Been meaning to jump in on the quiz, but haven't had the time... I can't
believe it's Wednesday already.

The attached just judges the solution on a number of criteria - I don't
like that bob's solution has some people playing others 4 times and
others only once... seems it should work more evenly than that, but busy
busy busy....

I did get as far as calling my class LogicalChart in response to bob's
(because I ripped off the framework in the hope of getting further).

rater.rb (1.73 KB)

···

-----Original Message-----
From: James Edward Gray II [mailto:james@grayproductions.net]
Sent: Wednesday, 30 November 2005 4:00 PM
To: ruby-talk ML
Subject: Re: [QUIZ][SOLUTION] Pinewood Derby Chart (#56)

On Nov 28, 2005, at 3:43 PM, Bob Showalter wrote:

> The core of my solution is at:
>
> http://users.adelphia.net/~showaltb/rubyquiz/56/derby.rb
>
> It assigns cars by computing a "weight" factor for each car
based on
> the following criteria:
>
> a) How many times has the car been assigned to this lane?
> b) How many times has the car been matched up against the
opponents
> already slotted to this heat?
> c) How long has it been since the car was last scheduled
to a heat?
>
> The weight factors act as a bias against selecting a car.

I dig any Ruby program with a class called ChaoticChart!
Seriously, this is a very interesting solution to read. Must
by why you scared all the others off. You just can't compete
with true chaos. :wink:

James Edward Gray II

#####################################################################################
This email has been scanned by MailMarshal, an email content filter.
#####################################################################################

Daniel Sheppard wrote:

Been meaning to jump in on the quiz, but haven't had the time... I can't
believe it's Wednesday already.

The attached just judges the solution on a number of criteria - I don't
like that bob's solution has some people playing others 4 times and
others only once... seems it should work more evenly than that, but busy
busy busy....

Yes, that's the challenge. How to improve the fairness of the matchups. In practice, what I've done is to run my generator through hundreds of trials, selecting the best chart generated. I haven't hit upon a way to either generate an optimal solution initially or improve an existing solution (perhaps some kind of genetic algorithm?)

I've posted a longer version of my approach at:

   http://users.adelphia.net/~showaltb/rubyquiz/56/derby2.rb

This contains my statistical evaluation logic and a second generator, RoundRobinChart, which uses a very naive round-robin lane assignment. It also contains routines to serialize and deserialize a chart (it uses a simple text format instead of YAML or Marshal)