import java.util.*;
import java.awt.*;
import java.applet.Applet;
import java.awt.event.*;
import javax.swing.*;
class fa1 extends f_xj//Rosenbrock function
{
public double func(double x[]) 
{
//çözümü istenen fonksiyon	
double ff;
ff=(1.0-x[0])*(1.0-x[0])+100*(x[1]-x[0]*x[0])*(x[1]-x[0]*x[0]);
return ff; 
}
} 

public class atesbocegitesti
{
public static void main(String arg[])
{
fa1 ff=new fa1();
double xmin[]={0,0};
double xmax[]={2.0,2.0};
double gamma=1.0;
double alpha0=0.5;
double alphan=0.01;
atesbocegi  ffly=new atesbocegi(ff,1000,2,xmin,xmax,gamma,alpha0,alphan,1000);
double x0[]=ffly.xmin();
double r1[]= atesbocegi.nelder(ff,x0);
String s="atesbocegi search : \n"+ffly.toString()+"\n Nelder-Mead: \n"+ffly.toString(ff,r1);     
     String s2="atesbocegi-Nelder-Mead simplex optimizasyon metodu ";
     System.out.println(s2+s);
}
}
