/* ---------------------------------------------------------------------------- ex12.C mbwall 13apr95 Copyright (c) 1995-1996 Massachusetts Institute of Technology DESCRIPTION: This example shows how to use an order-based string genome. ---------------------------------------------------------------------------- */ #include #include #include #include #include #include #include // This is the declaration of the objective function that we will use in this // example. float objective(GAGenome &); // Every genome must have an initializer. Here we declare our own initializer // that will be used in this example. void AlphabetInitializer(GAGenome &); int main(int argc, char *argv[]) { cout << "Example 12\n\n"; cout << "This program illustrates the use of order-based strings. The\n"; cout << "string in this problem contains 26 letters, a to z. It tries\n"; cout << "to put them in alphabetic order.\n\n"; cout.flush(); // See if we've been given a seed to use (for testing purposes). When you // specify a random seed, the evolution will be exactly the same each time // you use that seed number. for(int ii=1; ii