| By Derek Ferguson | Article Rating: |
|
| May 30, 2008 12:30 PM EDT | Reads: |
4,004 |
There are three key components that must be defined in a classic genetic application: a pre-defined set of Genomes, some number of Expression Trees that will be determined at run time, and a Generator.
A Genome represents some small combination of decision points, which are known as Functions, and operations, which are known as Terminals. In our model, a typical Genome might say, “If the stock is overpriced, sell it.” In this case, the decision “is this stock overpriced?” is a Function, which is supported by a single terminal: sell it. If we added the instruction that it should buy any stock that is not overpriced – an “else” clause – then we would have two terminals within this Genome.
Expression Trees are collections of Genomes that represent the complete body of intelligence for a given stock selection agent in our algorithm. By combining multiple Genomes, we can arrive at Expression Trees that are complex enough to buy, short sell, or ignore stocks under a variety of circumstances.
The Generator is the part of our architecture that is responsible for creating a new Expression Tree for every agent in each new generation. The Generator must then assess the degree of success for each Expression Tree and ensure that more successful Expression Trees are used as a basis for agents in succeeding generations rather than less successful ones. In our case, the successfulness of an expression tree will be determined by the average ratio between the original price of a stock and the price of its last execution, inverted if the “short sell” operation was selected, compared to a fixed amount of inflationary-related loss when algorithms choose to ignore stocks.
Table 1 shows an example that might make this clearer. We’ve chose a 3% rate of inflation, which is extremely high for a daily rate, but the amount of gains might be similarly high, depending on the stock and volatility of the market.

We are using large numbers for illustrative purposes, to make the differences more apparent.
Choosing a Grid Architecture
Digipede supports six primary models of usage. Table 2 briefly summarizes each option and the degree to which it is a fit for our application.
As you can see in Table 2, we’re going to use the Executive Worker pattern to implement our distributed genetic algorithm for stock selection. Our main application will download the list of top stocks, create an initial set of Worker objects containing our first Expression Trees, then submit a JobTemplate to Digipede that contains this information and specifies an Executive component. When the job is submitted, all of this will be streamed out to the remote computing resources. These agents on these remote resources will load the Executives and keep them in process will the Expression Trees are run. Every N generations (configurable), the most successful Expression Tree from each Executive will be returned to the main Generator for cross-breeding and redistribution, along with a new stock list.

Next Steps
Now that we understand the basic principles and design for our solution, it’s time to delve into the code. Part Two of this article will walk through our implementation, discuss issues, and present a few opportunities for further improvement.
Published May 30, 2008 Reads 4,004
Copyright © 2008 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By Derek Ferguson
Derek Ferguson, founding editor and editor-in-chief of .Net Developer's Journal, is a noted technology expert and former Microsoft MVP.
- Kindle 2 vs Nook
- Confessions of a Ulitzer Addict
- IBM Hardware Chief, Intel VC Exec Arrested in Insider Trading Scam
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- Infrastructure-as-a-Service Will Mature in 2010: Microsoft's David Chou
- Windows 7 – Microsoft’s First Step to the Cloud
- Cloud Expo and the End of Tech Recession
- Jill Tummler Singer, Deputy CIO of CIA, Keynotes at GovIT Expo
- Reality Check at the Cloud Computing Expo
- Visual Studio 2010 Is Cloud Friendly
- Fired SCO CEO Fires Back
- Kindle 2 vs Nook
- The Difference Between Web Hosting and Cloud Computing
- Ajax in RichFaces 3.3, JSF 2 and RichFaces 4
- Confessions of a Ulitzer Addict
- Wave on Ulitzer: Confessions of a Google Wave Fanboy
- IBM Hardware Chief, Intel VC Exec Arrested in Insider Trading Scam
- Cloud Computing Best Practices
- Tactical Cloud Computing Panel at 1st Annual GovIT Expo
- Ulitzer.com Named Exclusive "New Media" Sponsor of Cloud Computing Conference & Expo
- Infrastructure-as-a-Service Will Mature in 2010: Microsoft's David Chou
- Eval JavaScript in a Global Context
- Windows 7 – Microsoft’s First Step to the Cloud
- Google Maps and ASP.NET
- Crystal Reports XI & How It Has Changed
- Converting VB6 to VB.NET, Part I
- Creating Controls for.NET Compact Framework in Visual Studio 2005
- Where Are RIA Technologies Headed in 2008?
- How to Write High-Performance C# Code
- AJAX World RIA Conference & Expo Kicks Off in New York City
- Implementing Tab Navigation with ASP.NET 2.0
- i-Technology Photo Exclusive: Bill Gates & Steve Jobs In "Nerds"
- .NET Archives: Getting Reacquainted with the Father of C#
- i-Technology Viewpoint: "SOA Sucks"
- Programmatically Posting Data to ASP .NET Web Applications




























