  public double eval(Vector2d pos, GameState gs) {

        // IF in edible phase
        //move towards pills
        // and towards the ghosts

        double val=0;
        double ghostDis, edibleDis, pillDis,secondGhostDis,secondEdibleDis,
                powerPillDis ;

        if(gs.edible){

   //         System.out.println("CAN EAT GHOSTS");
            if (gs.closestPill != null) {
                 pillDis=pos.dist(gs.closestPill);
            } else {
                pillDis=0;
            }

            if(gs.closestEdible !=null){
                edibleDis=pos.dist(gs.closestEdible);
            }
            else{
              edibleDis=0;
            }

            if(gs.secondEdible !=null){
                secondEdibleDis=pos.dist(gs.secondEdible);
            }
            else{
              secondEdibleDis=0;
            }

            val= val + (100*pillDis+50*edibleDis+10*secondEdibleDis);
            return val;
        }

        // IF not in edible phase
        // move towards pills
        //  and away from ghosts
        else{

   //         System.out.println("cant eat ghosts");
            val=0;
            if (gs.closestPill != null) {
                 pillDis=pos.dist(gs.closestPill);

            } else {
                pillDis=0;
            }
            if(gs.closestGhost != null){
                ghostDis=pos.dist(gs.closestGhost);
             }
             else{
                 ghostDis=0;
             }

             if(gs.secondGhost != null) {
                secondGhostDis=pos.dist(gs.secondGhost);
             }
             else{
                 secondGhostDis=0;

             }

            //val=val-(pillDis);
//            val=val+(100*ghostDis);
            val=val+200*pillDis;
            val=val-(200*ghostDis);
            return val;
        }

    }
















