
************ Source Code Package of Multi-Objective Density-driven Evolutionary Algorithm (MODdEA) ************

based on [1] Chi Kin Chow and Shiu Yin Yuen, A Multi-objective Evolutionary Algorithm that Diversifies Population by its Density,
to appear in IEEE Trans. on Evolutionary Computation.

-----------------------------------------------------------------------------------------------


				~~~~~~~~ PART 1 ~~~~~~~~


The package contains 18 essential source files:

1. MODdEA_Kernel.C - Functions involved in MODdEA
2. MODdEA_Kernel.H - Function prototypes of "MODdEA_Kernel.C"

3. MODdEA_Main.C - Examples of MODdEA
4. MODdEA_Main.H - Function prototypes of "MODdEA_Main.C"

5. MultiObjective_Kernel.C - Functions related to Paretofront
6. MultiObjective_Kernel.H - Function prototypes of "MultiObjective_Kernel.H"

7. MultiObjective_TestFunction_Kernel.C - The tested function appeared in [1]
8. MultiObjective_TestFunction_Kernel.H - Function prototypes of "MultiObjective_TestFunction_Kernel.C"

9.  MyProblem.C - A sample MO problem
10. MyProblem.H - Function prototypes of "MyProblem.C"

11. MultiObjective_Testfunction_KUR_OptimalParetofront - Optimal Pareto front of KUR
12. MultiObjective_Testfunction_POL_OptimalParetofront - Optimal Pareto front of POL
13. MultiObjective_Testfunction_TYD01_OptimalParetofront - Optimal Pareto front of TYD01
14. MultiObjective_Testfunction_TYD02_OptimalParetofront - Optimal Pareto front of TYD02
15. MultiObjective_Testfunction_TYD03_OptimalParetofront - Optimal Pareto front of TYD03
16. MultiObjective_Testfunction_TYD04_OptimalParetofront - Optimal Pareto front of TYD04
17. MultiObjective_Testfunction_TYD05_OptimalParetofront - Optimal Pareto front of TYD05
18. MultiObjective_Testfunction_TYD06_OptimalParetofront - Optimal Pareto front of TYD06

They are written in C language
-----------------------------------------------------------------------------------------------


				~~~~~~~~ PART 2 ~~~~~~~~


Procedure of calling MODdEA


1. Define variable for MODdEA. In this example, the variable is 'cur_MODdEA'

	MODdEA cur_MODdEA;


2. Construct a struct of MODdEA and assign the struct to 'cur_MODdEA'

	MODdEA_Construction(&cur_MODdEA, pop1, pop2, no_dimension, no_function, no_evaluation);

	i.   pop1: size of parent population size
	ii.  pop2: size of offspring population size
	iii. no_dimension: function dimension
	iv.  no_function: number of objective involved
	v.   no_evaluation: number of evaluations


    2.1 - While optimizing the MO problems appeared in [1]. One can call the fucntions:

         a. MultiObjective_TestFunction_Information(testfunction_index)
    	 b. MultiObjective_TestFunction_OptimalParetoFront_Construction(testfunction_index)
         
         These functions return 7 pieces of information of a problem indicated by the variable 'testfunction_index'.
         The returned information is
		 i)    Number of dimensions                -> 'MultiObjective_TestFunction_no_Dimension'
		 ii)   Number of objectives                -> 'MultiObjective_TestFunction_no_Function'
		 iii)  Search space                        -> 'MultiObjective_TestFunction_SearchSpace'
		 iv)   Function pointer                    -> 'MultiObjective_TestFunction_Pointer'
		 v)    Function name                       -> 'MultiObjective_TestFunction_Name'
		 vi)   Optimal Paretofront                 -> 'MultiObjective_TestFunction_OptimalParetoFront'
		 vii)  Optimization mode of each objective -> 'MultiObjective_TestFunction_OptimizationMode'


3. Define the parameters of MODdEA

    3.1 - Search space

        for(i=0; i< MultiObjective_TestFunction_no_Dimension; ++i)
        {
            cur_MODdEA.MOEA_Info.SearchSpace[i][0] = MultiObjective_TestFunction_SearchSpace[i][0];
            cur_MODdEA.MOEA_Info.SearchSpace[i][1] = MultiObjective_TestFunction_SearchSpace[i][1];
        }

    3.2 - Optimzation Mode

        Optimization_Mode[i] = 0 if the i^th objective is undergoing Minimization
                                                                     ^^^^^^^^^^^^
        Optimization_Mode[i] = 1 if the i^th objective is undergoing Maximization
                                                                     ^^^^^^^^^^^^
        
        for(i=0; i< MultiObjective_TestFunction_no_Function; ++i)
            cur_MODdEA.MOEA_Info.Optimization_Mode[i] = MultiObjective_TestFunction_OptimizationMode[i];

    3.3 - Crossover rate

    	cur_MODdEA.MOEA_Info.CrossOver_Rate = 0.1;


4. Execute MODdEA

	MODdEA_Kernel(&cur_MODdEA, terminate_mode, terminate_parameter, testfunction_pointer);

	i.  no_generation:  Number of generations
	ii. terminate_mode: 0 = terminate after 'terminate_parameter' generations
                        1 = terminate when the best-found fitness reaches 'terminate_parameter'

	iii terminate_parameter: = max. no. of generations if terminate_mode = 0
                             = target fitness if terminate_mode = 1

	iv. testfunction_pointer = function pointer of the objective function.
				  
    **The valid function format of objective function is discussed in Part 3

    Example: MODdEA_Kernel(&cur_MODdEA, 0, 100, MyProblem) = Apply the MODdEA (cur_MODdEA) with 100 generations to optimize the function 'MyProblem'


5. Get the best found Pareto solution set and Pareto front

	Best found Pareto solution set = {cur_MODdEA.MOEA_Info.ParetoFront_Info.Paretofront_Solution[i]}
	Best found Pareto front = {cur_MODdEA.MOEA_Info.ParetoFront_Info.Paretofront_Fitness[i]}
    
    where           cur_MODdEA.MOEA_Info.ParetoFront_Info.Paretofront_Rank[i] == 1

6. Destruct the struct of MODdEA

	Example: MODdEA_Destruction(cur_MODdEA)


7. Destruct the struct of Optimal Paretofront

	Example: ParetoFront_Info_Destruction(MultiObjective_TestFunction_OptimalParetoFront);


----------------------------------------------------------------------------------------------


				~~~~~~~~ PART 3 ~~~~~~~~


Function prototype of objective function:

	
	void MyProblem(double*, double**)


Example:


	void MyProblem(double *X, double **F)
	{
		int i,j;

		for(i=0; i< 2; ++i)
        {
            (*F)[i] = 0.0;
    		for(j=0; j< 2; ++j)
        		(*F)[i] += pow(X[j]-MyProblem_Parameter[i][j],2);
        }
		return;
	}


Note that, in the objective function, all variables that are indpendent of the optimization process. They should be
implemented as global variables so that the prototype can be standardized. In the above example, the bias 'MyProblem_Parameter[][]'
should be declared as global variable.


============ MyProblem.h ============ 

double MyProblem_Bias[2][2];

void MyProblem(double*, double**);


============ MyProblem.c ============

#include<MyProblem.h>

void MyProblem(double *solution, double **fitness)
{
	int i, j;

	for(i=0; i<2; ++i)
	{
		(*fitness)[i] = 0.0;
		for(j=0; j<2; ++j)
			(*fitness)[i] += pow(solution[j]-MyProblem_Bias[i][j],2);
	}

	return;
}



