}
r+=1.0;
if(r>=reportFes)
{
r=0.0;
reports.add(new Report(pop, best, fes));
}
/* try
{
if(fx.getD()==1)
{
out.write("plot(x,y,type='l')\n");
out.write("points("+xbest[0]+","+xbest[1]+",pch=4,cex=2)\n");
out.write("points("+pop.get(0)[0]+","+pop.get(0)[1]+",pch=19,cex=1.5)\n");
out.write("points("+u[0]+","+u[1]+",pch=19,cex=1.1,col='red',bg='red')\n");
//out.write("dev.copy(png,'"+String.valueOf(fes).substring(0,String.valueOf(fes).indexOf("."))+".png')\n");
String format = String.format("%%0%dd", 4);
String result = String.format(format,Integer.parseInt(String.valueOf(fes).substring(0,String.valueOf(fes).indexOf("."))));
out.write("savePlot(filename='plot/"+result+"', type='jpeg')\n");
}
if(fx.getD()==2)
{
out.write("res<-persp(x,y,z,theta=30,phi=40)\n");
out.write("points(trans3d("+xbest[0]+","+xbest[1]+","+xbest[2]+",res),pch=4,cex=2)\n");
out.write("points(trans3d("+pop.get(0)[0]+","+pop.get(0)[1]+","+pop.get(0)[2]+",res),pch=19,cex=1.5)\n");
out.write("points(trans3d("+u[0]+","+u[1]+","+u[2]+",res),pch=19,cex=1.1,col='red',bg='red')\n");
//out.write("dev.copy(png,'"+String.valueOf(fes).substring(0,String.valueOf(fes).indexOf("."))+".png')\n");
String format = String.format("%%0%dd", 4);
String result = String.format(format,Integer.parseInt(String.valueOf(fes).substring(0,String.valueOf(fes).indexOf("."))));
out.write("savePlot(filename='plot/"+result+"', type='jpeg')\n");
}
}
catch(Exception e)
{
System.out.println(e.getMessage());
}*/
if(error<precision)
{
System.out.println(fx.evaluate(xbest));
}
}
reports.add(new Report(pop, best, fes));
/*try{
out.close();
of.close();
}