import java.util.*;
import java.awt.*;
import java.applet.Applet;
import java.awt.event.*;
import javax.swing.*;

class fa extends f_xj
{
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 Harmonytest {

	public static void main(String[] args) {

		fa ff=new fa();
		double xmin[]={0,0};
        double xmax[]={4,4};
        int maxIter=2500000;
        double BW=0.3;
        double HMCR=0.95;
        int HMS=400;
        double PAR=0.7;
		HarmonySearch hs=new HarmonySearch(ff,xmin,xmax,maxIter,BW,HMCR,HMS,PAR);
		String s="Harmony search : \n"+hs.toString()  ;  
        String s2="Harmony search optimization method ";
        JOptionPane.showMessageDialog(null,s,s2,JOptionPane.PLAIN_MESSAGE);
        ContourPlot pp = new ContourPlot(ff,-10.0,10.0,200,-10.0,10.0,200,40, false,"Harmony search optimisation", "x", "y");
		pp.plot();
	}
}
