GAAttack test = new GAAttack(game, this.enemies.get(en), v,Math.max((v.size()+attacks[i])*2, 40),30);
GAAttack test = new GAAttack(game, this.enemies.get(en), v,Math.max((v.size()+attacks[i])*2, 40),30, en.isEnemyOf((Entity)getEntitiesOwned().elementAt(0)));
  public GAAttack bestAttack(EntityState es) {    int entNum = es.entity.getId();    Entity en = es.entity;    int attacks[] = new int[3];    Vector front = new Vector();    Vector left = new Vector();    Vector right = new Vector();    GAAttack result = null;    int o_facing = en.getFacing();    for (Enumeration i = en.getWeapons();i.hasMoreElements();) {      Mounted mw = (Mounted)i.nextElement();      Vector c = this.calculateWeaponAttacks(en, mw,true);      if (c.size() > 0) {        front.add(c);        attacks[0] = Math.max(attacks[0], c.size());      }      if (!en.isProne()) {        en.setSecondaryFacing((o_facing + 5)%6);        c = this.calculateWeaponAttacks(en, mw,true);        if (c.size() > 0) {          left.add(c);          attacks[1] = Math.max(attacks[1], c.size());        }        en.setSecondaryFacing((o_facing + 1)%6);        c = this.calculateWeaponAttacks(en, mw,true);        if (c.size() > 0) {          right.add(c);          attacks[2] = Math.max(attacks[2], c.size());        }      }      en.setSecondaryFacing(o_facing);    }    Vector arcs = new Vector();    arcs.add(front);    arcs.add(left);    arcs.add(right);    double max = 0;    int[] results = null;    int arc = 0;    for (int i = 0; i < arcs.size(); i++) {      Vector v = (Vector)arcs.elementAt(i);      if (v.size() > 0) {        try {          GAAttack test = new GAAttack(game, this.enemies.get(en), v,Math.max((v.size()+attacks[i])*2, 40),30);          Thread threadTest = new Thread(test);          threadTest.start();          threadTest.join();          if (test.getFittestChromosomesFitness() > max) {            max = test.getFittestChromosomesFitness();            results = test.getResultChromosome();            arc = i;            result = test;          }        } catch (GAException gae) {          System.out.println(gae.getMessage());        } catch (Exception e) {          e.printStackTrace();        }      }    }    return result;  }