public Plot add(String label,Population population,int x,int y){
  List<Number> xs=new ArrayList<Number>();
  List<Number> ys=new ArrayList<Number>();
  for (  Solution solution : population) {
    if (!solution.violatesConstraints()) {
      xs.add(solution.getObjective(x));
      ys.add(solution.getObjective(y));
    }
  }
  scatter(label,xs,ys);
  setLabelsIfBlank("Objective " + (x + 1),"Objective " + (y + 1));
  return this;
}

public Plot add ( String label , Population population , int x , int y ) { List < Number > xs = new ArrayList < Number > ( ) ; List < Number > ys = new ArrayList < Number > ( ) ; for ( Solution solution : population ) { if ( ! solution . violatesConstraints ( ) ) { xs . add ( solution . getObjective ( x ) ) ; ys . add ( solution . getObjective ( y ) ) ; } } scatter ( label , xs , ys ) ; setLabelsIfBlank ( "Objective " + ( x + 1 ) , "Objective " + ( y + 1 ) ) ; return this ; }
displays the solutions in the given population in a 2d scatter plot . the two given objectives will be displayed .
