import java.io.*;


class fa extends f_xj
{
 double func (double x[])
 {
    return 21.5+x[0]*Math.sin(4.0*Math.PI*x[0])+x[1]*Math.sin(20.0*Math.PI*x[1]);
 }
}

class GeneticTest3
{
    public static void main(String args[]) throws IOException
    {
    int POPSIZE=500;
    int MAXGENS=1000;
    int NVARS=2;
    double PXOVER=0.3;
    double PMUTATION=0.08;
    fa fx=new fa();
    Genetic xx=new Genetic(POPSIZE,MAXGENS,NVARS,PXOVER,PMUTATION);
    double low[]=new double[NVARS];
    double high[]=new double[NVARS];
    low[0]=-3.1;high[0]=12.1;
    low[1]=4.1;high[1]=5.8;
    xx.setPopulation(low,high);
    System.out.println("best="+Matrix.toStringT(xx.calculate(fx))); 
    }
}
