import java.io.*;

class fa extends f_xj
{
public double func(double x[]) 
{
//çözümü istenen fonksiyon	
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; //maksimum testi
}
}

class OPO17C
{
    public static void main(String args[]) throws IOException
    {
    int N=25;
	int POPSIZE=400;
    int MAXGENS=400;
    int NVARS=2;
    double PXOVER=0.3;
    double PMUTATION=0.02;
    fa fx=new fa();
    Genetic2 xx=new Genetic2(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))); 
    }
}
