public synchronized void draw_World(){
       //for each cells 
       ant1nbCells=0;
       ant2nbCells=0;
       ant3nbCells=0;
       ant4nbCells=0;
        for (int x=0;x<WIDTH;x++){
            for (int y=0;y<HEIGHT;y++){
                //test is colorized
                if (world.getLocation().get((WIDTH*y)+x).isColorized()){
                    //System.out.print("(x,y)=("+x+","+y+")&");
                    //yes draw a point with this color
                    wimgWorld.getPixelWriter().setColor(x, y, world.getLocation().get((WIDTH*y)+x).getColorS());
                    if (world.getLocation().get((WIDTH*y)+x).getName().compareTo(ANT1)==0){ant1nbCells++;}
                    if (world.getLocation().get((WIDTH*y)+x).getName().compareTo(ANT2)==0){ant2nbCells++;}
                    if (world.getLocation().get((WIDTH*y)+x).getName().compareTo(ANT3)==0){ant3nbCells++;}
                    if (world.getLocation().get((WIDTH*y)+x).getName().compareTo(ANT4)==0){ant4nbCells++;}
                }
                else 
                {
                    //no draw a black point
                     wimgWorld.getPixelWriter().setColor(x, y, javafx.scene.paint.Color.BLACK);
                }
            }
        }
        imgWorld.setImage(wimgWorld); //show me the result on scsreen
        //refresh counters
        lbTotalCellsNb.setText(nbTotalCells+" cells");
        lbAnt1CellsNb.setText(ant1nbCells+" cells ("+formatter.format(((double)ant1nbCells/nbTotalCells)*100)+"%)");
        lbAnt2CellsNb.setText(ant2nbCells+" cells ("+formatter.format(((double)ant2nbCells/nbTotalCells)*100)+"%)");
        lbAnt3CellsNb.setText(ant3nbCells+" cells ("+formatter.format(((double)ant3nbCells/nbTotalCells)*100)+"%)");
        lbAnt4CellsNb.setText(ant4nbCells+" cells ("+formatter.format(((double)ant4nbCells/nbTotalCells)*100)+"%)");
    }
public synchronized void draw_World(){
      
       ant1nbCells=0;
       ant2nbCells=0;
       ant3nbCells=0;
       ant4nbCells=0;
        for (int x=0;x<WIDTH;x++){
            for (int y=0;y<HEIGHT;y++){
               
                if (world.getLocation().get((WIDTH*y)+x).isColorized()){
                   
                   
                    wimgWorld.getPixelWriter().setColor(x, y, world.getLocation().get((WIDTH*y)+x).getColorS());
                    if (world.getLocation().get((WIDTH*y)+x).getName().compareTo(ANT1)==0){ant1nbCells++;}
                    if (world.getLocation().get((WIDTH*y)+x).getName().compareTo(ANT2)==0){ant2nbCells++;}
                    if (world.getLocation().get((WIDTH*y)+x).getName().compareTo(ANT3)==0){ant3nbCells++;}
                    if (world.getLocation().get((WIDTH*y)+x).getName().compareTo(ANT4)==0){ant4nbCells++;}
                }
                else 
                {
                   
                     wimgWorld.getPixelWriter().setColor(x, y, javafx.scene.paint.Color.BLACK);
                }
            }
        }
        imgWorld.setImage(wimgWorld);
       
        lbTotalCellsNb.setText(nbTotalCells+" cells");
        lbAnt1CellsNb.setText(ant1nbCells+" cells ("+formatter.format(((double)ant1nbCells/nbTotalCells)*100)+"%)");
        lbAnt2CellsNb.setText(ant2nbCells+" cells ("+formatter.format(((double)ant2nbCells/nbTotalCells)*100)+"%)");
        lbAnt3CellsNb.setText(ant3nbCells+" cells ("+formatter.format(((double)ant3nbCells/nbTotalCells)*100)+"%)");
        lbAnt4CellsNb.setText(ant4nbCells+" cells ("+formatter.format(((double)ant4nbCells/nbTotalCells)*100)+"%)");
    }
public synchronized void draw_world(){ ant1nbcells=0; ant2nbcells=0; ant3nbcells=0; ant4nbcells=0; for (int x=0;x<width;x++){ for (int y=0;y<height;y++){ if (world.getlocation().get((width*y)+x).iscolorized()){ wimgworld.getpixelwriter().setcolor(x, y, world.getlocation().get((width*y)+x).getcolors()); if (world.getlocation().get((width*y)+x).getname().compareto(ant1)==0){ant1nbcells++;} if (world.getlocation().get((width*y)+x).getname().compareto(ant2)==0){ant2nbcells++;} if (world.getlocation().get((width*y)+x).getname().compareto(ant3)==0){ant3nbcells++;} if (world.getlocation().get((width*y)+x).getname().compareto(ant4)==0){ant4nbcells++;} } else { wimgworld.getpixelwriter().setcolor(x, y, javafx.scene.paint.color.black); } } } imgworld.setimage(wimgworld); lbtotalcellsnb.settext(nbtotalcells+" cells"); lbant1cellsnb.settext(ant1nbcells+" cells ("+formatter.format(((double)ant1nbcells/nbtotalcells)*100)+"%)"); lbant2cellsnb.settext(ant2nbcells+" cells ("+formatter.format(((double)ant2nbcells/nbtotalcells)*100)+"%)"); lbant3cellsnb.settext(ant3nbcells+" cells ("+formatter.format(((double)ant3nbcells/nbtotalcells)*100)+"%)"); lbant4cellsnb.settext(ant4nbcells+" cells ("+formatter.format(((double)ant4nbcells/nbtotalcells)*100)+"%)"); }