Building a word clock with genetic algorithms

Maybe it was a language barrier he ran into, or possibly an inclination to do things the hard and smart way, but we really like [Alessio]‘s take on building the display for his word clock. Instead of relying on a pre-designed word layout, he made his own word pattern with a genetic algorithm.

While looking at other word clock builds on the Internet, [Alessio] noticed all the DIY copies used the same pattern of letters as the original QLOCKTWO word clock. There are obvious reasons for this, laziness chief among them, but [Alessio] decided to do one better. Armed with JGAP, he made a 10×10 German language word clock and a 11×11 English language word clock.

[Alessio]‘s algorithm takes a list of regular expressions – ‘five past four’ and ‘four five’ are both valid expressions for 4:05 – and combines solutions together for a hopefully optimal solution. One added bonus of [Alessio]‘s method is the ability to generate non-square word clocks. On his project page, [Alessio] put up examples for round, triangular, and diamond-shaped word clocks.

[Alessio] ended up building a 10×10 square German language word clock with an Arduino Nano, DS1307 real-time clock, RGB LEDs, and a few shift registers. Very nice work for a custom-designed word clock.

Comments

  1. MrX says:

    “regular expressions”

    I don’t think that means what you think it means.

  2. Guy says:

    @MrX: The linked article gets it correct. That’s the issue you take away from this though? Not how cool the actual hack is? Give me a break.

    Anyways, to Alessio: This is awesome! Great practical use of GA.

  3. uC says:

    Looks clever. I’ve been looking to put one of these together based on a recent kickstarter project ClockTHREE.

    Alessio has definately made this much more interesting. Very clever use of the regexp to solve potential matches. I wonder if it could be used to find Vertical as well as horizontal matches.

    • Thopter says:

      Just take the groupings that the program puts out, and arrange them vertically before you cut the stencil.

    • Thopter says:

      “[Alessio] decided to do one better. Armed with JGAP, he made a 10×10 German language word clock”

      He did not use JGAP.

      “I just wanted to really understand the GAs and decided to program it *completely by myself*. For a real problem you would of course use one of the many GA frameworks (JGAP for example)”

  4. Thopter says:

    I have been unable to leave a comment on his site, so I’ll post it here.

    “Fourthy” and “fourty” should be changed to “forty”.

    Also, I’d change the :05 times to (.+?)(o)(.+?)(five)(.*).

  5. ellindsey says:

    “Fourthy”? Neat idea, but I think something was lost in translation.

    • Ivan says:

      I don’t know where that sample came from. But I’m glad I’m not the only one that fell for it. Try looking for “three” ;-)

      I guess it’s just a picture. Hehehe

  6. Chris says:
  7. th3BadWolf says:

    After reading through,I had to come back here and say:

    I freakin love GA,ever since the mona lisa I’ve been craving for more.Also got a 2D vehicule GA trying to climb a hill.I still have em somewhere on my computer if you want em,they are offline now.. =/

  8. Andrew says:

    4:05 is never “four five”, it’s “four oh-five”. If you’re an English speaker, that is.

  9. Thopter says:

    Has anyone else been able to get his java code to run? I’ve had no luck at all so far.

  10. gizmoguyar says:

    This type of clock appears to be quite popular so it’s cool to see a different spin on it. I have to say that all of the pictures I see online are rather ugly though. I just finished mine, and I have to boast that it’s definitely the coolest.

    http://www.augsoddsandends.com/Augs_Odds_And_Ends/Word_Clock.html

  11. Alessio says:

    Thanks everybody, I corrected the “fourty” typo and changed the :05 times as suggested by Thopter and Andrew.

    Whats the problem with the code? I just imported it in Eclipse and it runs without any problems….

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 96,534 other followers