if (c1.genes[r1] < 0) c1.genes[r1] = ((Vector)this.attack.elementAt(r1)).size() - 1;
if ( c1.genes[r1] < 0 && attack.size() > r1 ) { c1.genes[r1] = ((Vector)this.attack.elementAt(r1)).size() - 1; } else { c1.genes[r1] = 0; }
  protected void doRandomMutation(int iChromIndex) {    ChromVector c1 = (ChromVector)this.chromosomes[iChromIndex];    int r1 = Compute.randomInt(c1.genes.length - 1);    CEntity target = null;    boolean done = false;    if (r1%2 == 1) {      c1.genes[r1]--;      if (c1.genes[r1] < 0) c1.genes[r1] = ((Vector)this.attack.elementAt(r1)).size() - 1;      return;    }    //else try to move all to one target    for (int i = 0; (i < c1.genes.length - 1) && !done; i++) {      int iGene = (i + r1)%(c1.genes.length - 1);      TestBot.AttackOption a = (TestBot.AttackOption)((Vector)(attack.elementAt(iGene))).elementAt(c1.genes[iGene]);      if (a.target != null) {        target = a.target;        done = true;      }    }    if (target == null) { //then not shooting, so shoot something      c1.genes[r1] = Compute.randomInt(((Vector)(attack.elementAt(r1))).size() - 1);      TestBot.AttackOption a = (TestBot.AttackOption)((Vector)(attack.elementAt(r1))).elementAt(c1.genes[r1]);      if (a.target != null) {        c1.genes[c1.genes.length - 1] = a.target.enemy_num;      }    } else { //let's switch as many attacks as we can to this guy      for (int i = 0; (i < c1.genes.length - 1); i++) {        Object[] weapon = ((Vector)(attack.elementAt(i))).toArray();        if (c1.genes[i] != weapon.length - 1) {          done = false;          for (int w = 0; (w < weapon.length - 1) && !done; w++) {            TestBot.AttackOption a = (TestBot.AttackOption)weapon[w];            if (a.target.enemy_num == target.enemy_num) {              c1.genes[i] = w;              done = true;            }          }        }      }      ((ChromVector)this.chromosomes[0]).genes[chromosomeDim -1] = target.enemy_num;    }  }