import java.io.*;


class fa1 extends f_xj
{
   double func (double x[])
   {
    return x[0]*Math.sin(10.0*Math.PI*x[0])+1.0+2.0;
   }
}

class GeneticTest1
{
    public static void main(String args[]) throws IOException
    {
    int N=31;
	int POPSIZE=40;
    int MAXGENS=200;
    int NVARS=1;
    double PXOVER=0.3;
    double PMUTATION=0.01;
    fa1 fx=new fa1();
    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]=2.0;
    xx.setPopulation(low,high,fx);
    System.out.println("best="+Matrix.toStringT(xx.calculate(fx,true))); 
    }
}
