public vector2d foraging(ArrayList<Food> jedzonko,double kat_widzenia)
    {       
        vector2d jedziem=new vector2d(0,0);
        double s;
        Random randGen;
        double kat;
        Food target;
        ArrayList<Food> seeFood;
        if(this.hungry) {
            seeFood=new ArrayList<>();
            randGen=new Random();
            for(int i=0;i<jedzonko.size();i++)
            {   
                   s=this.position.getDistance(jedzonko.get(i).fpos);
                   if(s<=mainBoids.mainWin.getForagingDistance())
                   {
                       
                        kat=this.calcAngle((jedzonko.get(i).fpos));
                        if(s<skala*20) seeFood.add(jedzonko.get(i));
                        else {
                            if((3.1415-kat)<kat_widzenia)
                            {
                                 seeFood.add(jedzonko.get(i));
                            }
                        }
                   
                  }
                  target=NDistance.minFood(this,seeFood);
                  if(target!=null)
                  {
                    if(this.getPosition().getDistance(target.getPos())<=9)
                    {
                          mainBoids.simul.foraging_situation=true;
                          this.velocity=new vector2d(0,0);
                          eats++;
                          if(eats>=1200) 
                          {
                              hungry=false;
                              return new vector2d(randGen.nextDouble()-2,randGen.nextDouble()+4).normalize();
                          }
                        //jedziem.add(this.velocity);
                        // jedziem.multi(-14);
                          if(target.iam_eating())
                          {
                              jedzonko.remove(target);
                              mainBoids.simul.pom.clear();
                              mainBoids.simul.pom.addAll(mainBoids.obs);
                              mainBoids.simul.pom.addAll(mainBoids.food);
           
                          }
                    }
                    else {
                         mainBoids.simul.foraging_situation=true;
                         jedziem.add(target.fpos);
                         jedziem.minus(this.getPosition());
                         jedziem.normalize();
                    }
                }
            }
        }else{return jedziem;}
            return jedziem.multi(2);
    }