Re: crossword project works



On Tue, 29 Jan 2008 07:01:42 -0600, Malcolm McLean wrote
(in article <QqSdnU-3v8Q2vgLanZ2dnUVZ8gOdnZ2d@xxxxxx>):


"Randy Howard" <randyhoward@xxxxxxxxxxxxxxxxx> wrote in message

It takes a really long time to run with your recommended iteration
count, mainly because of the I/O to the console on each pass, even on
an unloaded 2GHz dual proc system.

That's an inherent snag with simulated annealing. I needed about a million
to regenerate the Times crossword from its clue list.

My only point there was that a -shutup flag to skip all the I/O would
make it run a lot faster, especially in slow terminal emulators, but
probably in all cases.

It seems to handle duplicate clues.

It knocks out duplicate words in the raw files , the idea being you can pass
it a novel or something.

Passing an iteration count of 100, generated output for 1125
iterations, but I didn't investigate further.

Passing an iteration count of 1000, generated output for 2525
iterations.

The simulated annealing code takes 1024 iterations simply to decide the
temperature regime. I should maybe make clear that you can't expect anything
worthwhile from short regimes.

I figured it had some minimum value that made sense, I just didn't work
out why the delta was different for the two cases.

If you pick small values for height and width (say 4), you just get a
black image and blank clue lists.

Your regime is so short that it never even gets a short word into first
place in the list for the first clue. That can be fixed, however.

Deciding on a way to determine minimum valid hxw and warning on
attempts to use something that doesn't fit might be a nice feature.

Then I gave it a clue file by concatenating the times and biochemistry
clues files then adding in a very few lines up top with some improperly
formed clues (they had one or more extra '/' chars in the clue portion
of the line). It generating a bunch lines looking like this:

That's exactly the sort of testing you tend not to do yourself. Thanks a
lot. This can be fixed of course

This is exactly the sort of testing that I always do, (and a lot more
of it) to try and break the code before I drop it in somebody else's
lap. If you don't try and break your own code, somebody else will, and
quite often way down the road when it is painful to fix. It could be
really expensive, representing a lost customer, a lawsuit, or even
physical harm (think control software for things a lot more dangerous
than crossword puzzles). Doing it even on the toy problems is good
practice.

This is especially true when parsing file formats, with command line
arguments and tunable parameters, etc. Assume the user is evil, and
arm yourself :)


--
Randy Howard (2reply remove FOOBAR)
"The power of accurate observation is called cynicism by those
who have not got it." - George Bernard Shaw





.



Relevant Pages

  • Re: Y&R -- Kevins Latest Felony
    ... and the current badness is worse than the last ... With every succeeding iteration, ... regime "inherits" what the last regime gave it. ... the fallout from her death has been very good. ...
    (rec.arts.tv.soaps.cbs)
  • Re: Speed Comparison Perl Python & C
    ... Bart> did. ... Your program prints stuff at every iteration, so it mostly measures I/O ...
    (comp.lang.python)