Freewill in progress (3)

freewill_oct_2

(Click on image to enlarge)

What’s new?

After a break from Freewill (I like to put projects aside for a while, it gives me another perspective on my own code!), I just came back to it yesterday.  I had a few WTF moments (it’s usually a good indication that your code is not clear!), renamed some methods with imprecise names, cleaned up some of Ruzzle’s crumbs that were sprinkled everywhere, refactored code here and there, looked at what Code Critics came up with and corrected some of the issues, ran a few tests and finally got fed up by performance issues.

I got rid of the SharedRandom number generator that was previously used in Freewill.  This resulted in a huge speedup! From what I measured, the Random class is 2.1 times faster than the SharedRandom one! This change alone brought a performance boost of 31-48% !  I also cached the cumulative weights for the Roulette Wheel selection policy which gave me a 14% speedup!  There are still a few things I want to optimize here and there and my estimates tell me I could get another 15-45% speedup.

What’s next?

I’ll start adding tests to cover all policies (creation, selection, crossover, mutation, termination) to make sure the next changes don’t break anything.  This will also give me reproduceable tests against which I’ll get more precise statistics to measure performance.  I will also start working on another example, most likely the 8 queens problem.

To Do List Until Next Update

  • 8 queens problem
  • Policies Tests
  • Speed up Roulette Wheel selection
  • Start to add class/method comments
  • Code 2-3 more termination policies
  • Think about Freewill’ community (Google group?  Mailing List? Repository? etc.)
Advertisements

Laisser un commentaire

Entrez vos coordonnées ci-dessous ou cliquez sur une icône pour vous connecter:

Logo WordPress.com

Vous commentez à l'aide de votre compte WordPress.com. Déconnexion / Changer )

Image Twitter

Vous commentez à l'aide de votre compte Twitter. Déconnexion / Changer )

Photo Facebook

Vous commentez à l'aide de votre compte Facebook. Déconnexion / Changer )

Photo Google+

Vous commentez à l'aide de votre compte Google+. Déconnexion / Changer )

Connexion à %s

%d blogueurs aiment cette page :