There are lots of errors in the tutorials for CTP1. This article will help you get things going.

I use a Lego Mindstorms RIS v2.0 with Microsoft’s Robotics Studio. If you have a different system, some of the steps will be different. This article will cover a lot of mistakes that are common to all the platforms. You should still find a lot of value in it. First, follow the installation instructions.

Once you have Visual C# Express, Lego Mindstorms SDK and Microsoft Robotics Studio installed, we’ll have to generate signing keys for the software you will write. This was intended to be a simple process, but the script that Microsoft provided does not work with the Express editions of Visual Studio. Microsoft has provided a new script. Replace the file in your Microsoft Robotics Studio directory with this one.

If you installed everything to the default locations, that updated script will work. If, like me you chose to install Visual C# somewhere else, you’ll have to edit the paths in SDKENV.CMD. At the beginning there are a number of paths defined. These all start with %PROGRAM_FILES%. This assumes that you have moved your program files directory. If you have installed Visual C# Express or Microsoft Robotics Studio elsewhere, you will have to correct all these paths.

Now run the Robotics Studio console and it will generate the keys for you. Next we’ll move on to Robotics Tutorial 1.

I’ve been working on my simple genetic algorithm in LabVIEW and struggling with memory. This was caused by a poor implementation of roulette wheel selection. I essentially created a very large array and randomly picked two parents from this array. The array contained multiple entries of each chromosome that was determined by it’s fitness score. This worked well enough for small populations and small fitness scores, but once things got big…

In this version, I implement a much improved roulette wheel selection algorithm. This is the algorithm documented on Marik Obitkos pages. The improvement was amazing. I found the new implementation gave me a 570x improvement with a population of 1500! And all my memory problems were gone. Developing the new implementation was a little frustrating. LabVIEW likes to make things simple and handle all the details for you such as variable type. This caused me a few headaches… The fitness score was implemented as a 16 bit signed integer. When I was calculating the sum of all fitness scores it was causing an overflow, but not raising any errors or warnings about this. The symptom I was seeing was that only one chromosome would make it through the selection process after a few runs. It wasn’t even the most fit one! After a lot of debugging, I saw this overflow. My next challenge was to convince LabVIEW to use an unsigned 32 bit integer to hold the data. I had to typecast the data going into the calculate sum vi in order to do this.
Here is version 3 with the new implementation of the selection algorithm.

Two weeks ago, I posted a simple genetic algorithm in LabVIEW. Since then, I’ve found a few bugs and yet more memory problems. In LabVIEW 8, the original ran fine. In LabVIEW 7.1, it would crash with large initial populations. I’ve managed to eliminate the memory problems by moving items to a subVI again. This is the updated version.
I also want to say thanks to IlliGAL Blogging for sending some traffic my way. They run an interesting blog covering the latest news in genetic algorithms.

Next Page »