import java.io.*;
import javax.swing.*;




class gibbsGenetic
{
    public static void main(String args[]) throws IOException
    {
    int N=63;
	int POPSIZE=200;
    int MAXGENS=200;
    int NVARS=5;
    double PXOVER=0.3;
    double PMUTATION=0.02;
   	     String iLK[]={ "co","o2","co2" };  	             
    	 double[] n0={1,1,0};
		 double Te[]={3000,3000,3000};	    
		 double T1=3000;
		 double P1=1.01325;
    f1gibbs fax=new f1gibbs(iLK,n0,Te,T1,P1); 
    Genetic1 xx=new Genetic1(POPSIZE,MAXGENS,NVARS,N,PXOVER,PMUTATION);
    double low[]=new double[NVARS];
    double high[]=new double[NVARS];
    low[0]=0;high[0]=1.0;
    low[1]=0.0;high[1]=1.0;
    low[2]=0.0;high[2]=1.0;
    low[3]=0.0;high[3]=1.0;
    low[4]=0.0;high[4]=1.0;
    xx.setPopulation(low,high,fax);
    double a[]=xx.calculate(fax,false);
    double x0[]=new double[NVARS];
    for(int i=0;i<NVARS;i++) x0[i]=a[i];
    String s="genetik algoritma sonucu =\n"+Matrix.toStringT(a);
     String s2="Genetik algoritma  çok değişkenli fonksiyon optimizasyonu:";
     JOptionPane.showMessageDialog(null,s,s2,JOptionPane.PLAIN_MESSAGE);     
    }
}
