public int accion( boolean PF, boolean PD, boolean PA, boolean PI, boolean MT ){
     int dir = (int)(4*Math.random());
     while( (dir==0 && PF) || (dir==1 && PD) || (dir==2 && PA) || (dir==3 && PI) ){
        dir = (int)(4*Math.random());
     };
     return dir;
  }