usage: java Evolver <termination type> <termination condition> <data file> <config file>

All identifier are not case sensitive.

For termination type, it can be time, generation or fitness (fitness was never used and I think is not useful)
and an integer is expect for the termination condition. This integer will be used for the differently depend on 
the termination type. For generation, it termination until the current generation reached the given number of
generation. For time, it repesent the second that is wanted to spend for the evolution, this will be check at
the end of each generation. If the time is expired, the evolution will stop otherwise it will go for the next 
generation. 

data file and config file require the name (or path) of the file which is wanted to load.

for example: java Evolver generation 1000 Gaussian_120_50_15.txt config.txt
             This will run the program for 1000 generation with Gaussian_120_50_15.txt as data and
             config the evolution following config.txt.
	
             java Evolver time 100 Gaussian_120_50_15.txt config.txt
             This will run with the same config and same data but run for 100 seconds instead.



Data file: 

The data file is assumed to contain both student IDs and scores. For each row, it should start with student ID,
followed be a space and the the scores. Note, the ID should be unique and scores can be positve or negative but
has to be an integer. The data file will be read until no more rows. 
Exception will be thrown if the fomart isn't matched.


Config file:

The config file should have 25 parameters (ie, 25 rows) with specific order (Some of them are not useful any more). 
Only the first 25 rows will be read.
Exception will be thrown if the fomart isn't matched.

The type of parameter and what it represent is list below. The config must be written in this order and each parameter
is contain in a new row.

1. integer: min value of score (usually 0, but can be any number including negative)

2. integer: max value of score (usually 100, any number greater than min value)

3. integer: group size (Has to be > 0)

4. integer: population size (number of chromosome in each generatin. Has to be > 0 and even)

5. String: type of initialization of population (keyword: random, striping and greedy)

6. String: type of selection (keyword: roulette, rank or tournament)

7. integer: selection parameter (Has to be > 0. For roulette, this has no effect. For tournament, this is the tournament size.
            For rank, this has to be also less than 100. And the rank will be this number divide by 100)

8. String: type of replacement (keyword: elitism, no elitism)

9. integer: replacement parameter (not used)

10. NOT USED: crossover type. 0 was put in config file

11. double: crossover rate (0 <= x <= 1)

12. NOT USED: mutate type. 0 was put in config file

13. double: mutation rate (0 <= x <= 1)

14. String: fitness function type (keyword: polynomial, exponential and logarithmic)

15. double: weight of SD of intergroup mean in fitness function

16. double: power/base of SD of intergroup mean in fitness function

17. double: weight of intra-group SD in fitness function (not in use now)

18. double: power/base of intra-group SD in fitness function (not in use now)

19. double: weight of SD of intra-group SD in fitness function

20. double: power/base of SD of intra-group SD in fitness function

21. integer: target for the sliding power in fitness (slide from 1 to this value as time or generation grow)

22. integer: target for the sliding tournament size (slide from initial size to this value as time or generation grow)

23. String: show or not show the detail of each generation (keyword: show and not show)

24. String: save or not save the detail as a file (the file name will be automatically generated. keyword: save or not save)

25. String: save with or without the detail of each generation in the file (keyword: simple and not simple)


fitness function:

The fitness function has three types. Polynomial, exponential and logarithmic. All of them are normalized so the 
value is always lie between 0 and 1. Each of the functions consist of three terms, they are SD of intergroup mean,
mean of intra-group SD (not used now) and SD of intra-group SD. Each of the terms take two scaling factors. The
first scaling factor is the coefficient (the name start with a) and the second factor contorls the base or power
depending on the type (the name start with b). 

polynormial: y = (- a1 * (SD_intergroup_mean / max_1) ^ b1 
                  + a2 * (mean_intragroup_SD / max_2) ^ b2 
                  - a3 * (SD_intragroup_SD / max_3) ^ b3 
                  ) / (a1 + a2 + a3)

exponential: y = (a1 * e^(-b1 * SD_intergroup_mean) 
                  + a2 * e^(b2 * (mean_intragroup_SD - max_2)) 
                  + a3 * e^(-b3 * SD_intragroup_SD)
                 ) / (a1 + a2 + a3)

logarithmic: y = (a1 * log(1 - (SD_intergroup_mean - max_1) / max_1)
                  + a2 * log(1 + mean_intragroup_SD / max_2)
                  + a3 + log(1 - (SD_intragroup_SD - max_3) / max_3)
                 ) / (a1 + a2 + a3)

                 where the log has base given by b1, b2, and b3

The max_1, max_2 and max_3 are the maximum intra group SD that for given group size.

The way to work out the maximum possible standard deviation with given mean, group size, min and max value.
To find out the maximum possible standard deviation, a simple idea is to maximize the difference between the data and the mean
ie. group of 4, mean = 50, then SD is maximized to 57.73 with group [100, 100, 0, 0]
for every group with even number of members, maximum SD occur exactly when mean = 50 
an interesting finding is, for group with odd number of members, the maximum SD is not occur at mean = 50
indeed, the maximum SD for group of n (odd) members is same as the maximum SD for group of n+1

Result is slightly worse than Yip Chongs best results...
I will check out Brendans last copy and work from there.

Looks like version 62 is one of the most interesting.
Check out and try that.

