At the forefront of Artificial Intelligence
  Home Articles Reviews Interviews JDK Glossary Features Discussion Search
Home » Reviews » Software » Genetic Algorithms

optiGA ActiveX Control

optiGA is a general purpose genetic algorithm ActiveX control that offers the programmer/user a range of existing features but also a good amount of flexibility. In short, optiGA's features include: Binary, real and integer data types, 4 different types of selection method, 4 crossover methods (including a user-defined one), 4 mutation methods (also including a user-defined method), 4 different termination functions and the option to minimize or maximize the objective.

The Features

The features mentioned above are all well implemented, many of the properties can be set using the optiGA properties box that the "Visual" development environments offer. Below is a screenshot:

It is evident that a lot of thought has gone into the various features and how they can tie into the sort of problems that optiGA will be applied to. OptiWater has provided some decent examples with the optiGA package to demonstrate the various attributes. The examples are also accompanied by an excellent manual that has an introduction to genetic algorithm theory and covers all the methods, events and public enumerations in detail.

Ease of Use

While I feel that optiGA's range of features is excellent, it is the "ease-of-use" factor that lets it down a little. The control seems very Visual Basic orientated; all the examples and the documentation is written in a form for VB users. When imported into Visual C++ it puts some strange restrictions on the programmer.

For example, passing something as simple as an integer requires you to pass a reference to a long variable. This effectively requires you to create a variable for every parameter you need to pass to optiGA. Thankfully, most of the optiGA settings can be set using the property sheet shown above.

Another ease issue has little to do with optiGA, but optiGA uses the VARIANT data type to pass things back and forth between the control and your application. This requires you to use SAFEARRAYs and other data types and functions that can overcomplicate simple issues. For example, here is the sample code required to display 4 values of a diophantine equation from the current generation:

void COptiGADlg::OnGenerationReportOptiga(float FAR* BestFitness, 
            long FAR* GenerationNumber, VARIANT FAR* BinaryGenes,
                VARIANT FAR* RealGenes, VARIANT FAR* IntegerGenes, 
                   long FAR* ElapsedTime, float FAR* GenerationMeanFitness) 
{
	VARIANT *pData;
	SafeArrayAccessData(RealGenes->parray,(void**)&pData);

	m_dA = pData[0].fltVal;
	m_dB = pData[1].fltVal;	
	m_dC = pData[2].fltVal;
	m_dD = pData[3].fltVal;	

	SafeArrayUnaccessData(RealGenes->parray);

	UpdateData(FALSE);
}
Like I've mentioned, this complexity is due to the flexibility the VARIANT data type offers. Once the initial problem of using the SAFEARRAYs to pass information to and from the control, optiGA is easy to use. I managed to create the classic diophantine example relatively quickly, since creating the necessary fitness and generation statistic handlers was trivial using ClassWizard.

As you can see, I chose to use real numbers (even though that defeats the "diophantine" aspect of it) instead of integers. The equation was hardcoded into the fitness function, and after 100 generations you can see that optiGA has generated a perfectly good solution (using those values, the equation yields 69.9999998).

Conclusion

If you are either a Visual Basic user or are used to handling all sorts of ActiveX controls under Visual C++, optiGA is a nice solution since it provides a good balance of existing functionality and the ability to override key elements of the GA. The reasonable price also puts it within reach of most project budgets. For those with little ActiveX experience in C++ might find it a little "unfriendly".

optiGA is available in a demonstration form that pops up a information dialog upon startup, see the OptiWater homepage for more details. Overall, optiGA is a good package with great features and excellent documentation but could have been a bit more language-independent.

No cover available 8.3
Price:$125
Liked:Good examples, decent documentation, some nice features.
Disliked:Not VC++ friendly.
Website:http://www.optiwater.com/

Last Updated: 14/03/2001

 Article Toolbar
Print
BibTeX entry

Search

Latest News
- New Generation5 Design! (09/04/2007)
- Happy New Year 2007 (02/01/2007)
- Where has Generation5 Gone?! (04/11/2005)
- NeuroEvolving Robotic Operatives (NERO) (25/06/2005)
- Senior Next-Gen Console Programmer at Infinity Ward (25/06/2005)

What's New?
- An Introduction to Hough Transforms (06/01/2008)
- Kohonen-based Image Analysis using the Generation5 JDK (12/12/2007)
- Back-propagation for the Uninitiated (10/04/2007)
- Perceptrons (09/04/2007)
- Modelling Bacteria using the Generation5 JDK (01/04/2007)


All content copyright © 1998-2007, Generation5 unless otherwise noted.
- Privacy Policy - Legal - Terms of Use -