import java.io.*;

class fb extends f_xj
{
public double func(double x[]) 
{
//function required to be solved
double ff;
ff=2.0*x[0]*x[1]+2.0*x[0]-x[0]*x[0]-2.0*x[1]*x[1]+10.0;
return ff; 
}
}

class NA104
{
    public static void main(String args[]) throws IOException
    {
    int N=18; //number of figits in binary genes
	int POPSIZE=200; //population size
    int MAXGENS=200; //maximum number of generations
    int NVARS=2; //number of variables (member of genes in genome
    double PXOVER=0.3; //probability of crossover
    double PMUTATION=0.02; //probability of mutation
    fb fx=new fb();
    Genetic1 xx=new Genetic1(POPSIZE,MAXGENS,NVARS,N,PXOVER,PMUTATION);
    double low[]=new double[NVARS];
    double high[]=new double[NVARS];
    low[0]=-1.0;high[0]=5.0;
    low[1]=-1.0;high[1]=5.0;
    xx.setPopulation(low,high,fx);
    System.out.println("best=\n"+Matrix.toStringT(xx.calculate(fx,false))); 
    }
}
