-- Overview of the examples
These are examples of using NetSolve Farming.
In these examples, the optimum points of test functions are derived by GA.

To use these examples, you should compile server and client software.
Then, you assign the examples into NetSolve server and you have to launch the server.

When you compile server and client, please read INSTALL.

-- Genetic Algorithm
Genetic Algorithm (GA) is the optimization algorithm that imitates the evolution of living creatures. In nature, inadaptable creatures to an environment meet extinction, and only adapted creatures can survive and reproduce. A repetition of this natural selection spreads the superior genes to conspecifics and then the species prospers. GA models this process of nature on computers. 
GA can be applied to several types of optimization problems by encoding design variables of individuals. Searching for the solution proceeds by performing the three genetic operations on the individuals; selection, crossover, and mutation, which play an important role in GA. Selection is an operation that imitates the survival of the fittest in nature. The individuals are selected for the next generation according to their fitness. Crossover is an operation that imitates the reproduction of living creatures. The crossover exchanges the information of the chromosomes among individuals. Mutation is an operation that imitates the failure that occurs when copying the information of DNA. Mutating the individuals in a proper probability maintains the diversity of the population.

-- Distributed Genetic Algorithm (DGA)
Since GA is a stochastic and multi-point search, a lot of iterations are necessary to derive the optimum solution.  This leads to take a huge time.  One of the solutions of this problem is performing GA in parallel.  There are several types of parallel GA.  Distributed Genetic Algorithm is one of models of parallel GAs.
In a conventional GA, there is only one population. In DGA, total population is divided into sub populations.  In each population, normal GA operations are performed for several iterations.  After some iterations, some of the individuals are chosen and moved to the other islands.  This operation is called migration.  Therefore, sometimes, sub population is called an island and DGA is called island model.  After the migration, normal GA operations restart again.  The population size of each island is small.  That leads the early convergence.  However, because of the existence of migration operation, total diversity of the solutions is maintained. Compared to the conventional model, DGA has higher searching capability.  It can be said that DGA is suitable model not only from the parallel point of view but also from the searching capability. 

-- ga2k
ga2k is an implementation of DGA that is developed by Intelligent Systems Design Lab (http://www.is.doshisha.ac.jp/top/index-en.html) /Doshisha University(http://www.doshisha.ac.jp).

The web page (Japanese) of ga2k is 
http://mikilab.doshisha.ac.jp/dia/research/pdga/archive/index.html
You can access to English document as follows.
http://mikilab.doshisha.ac.jp/dia/research/pdga/archive/20020925_ver1.3e/ga2k_doc_E2.pdf

If you want to know GA, please read README.

To use NetSolve farming function, ga2k is modified.
The logical model of ga2k is DGA but implementation model is Master slave model.

--Examples
In these examples, you can find an optimum point of traditional numerical test functions; those are 
   
        1. Rastrigin
        2. Schwefel
        3. Griewank 
        4. Ridge
        5. Rosenbrock. 

You can start GA optimization using ga2k in the directory of $NETSOLVE_ROOT/C++Examples/gaExample/client/ga2k-ns.

    $ cd $NETSOLVE_ROOT/C++Examples/gaExample/client/ga2k-ns
    $ ./ga2k-ms_netsolve O

    When you use option O, the output file fitness.out is created. 
    In this file, the generation and the best value of the generation are illustrated.
    The default function is the Rastrigin function.

    There are several options for ga2k.
	i: number of islands
	p: population size in each island
	D: problem size dimension
	g: generation number

    For example, 
    
    $ ./ga2k-ms_netsolve O i2 p20 D2 g30

    means there are 40 population(2*20) and 30 generations are used for two dimension Rastrigin function.

    If you want to use another test function, you can use F option.

    $ ./ga2k-ms_netsolve O i2 p20 D2 g30 Frosenbrock

    There are five types of test functions are prepared; those are rastrigin, schwefel, griewank,ridge ,and Rosenbrock.

Enjoy !! 
