276277278279280281282283284285
mutateInvertPunch(punches, pos); } private void mutateInvertPunch(ArrayList<PunchObject> punches, int pos) { if( pos<punches.size()-1 ) { PunchObject punch = punches.get(pos); punches.set(pos, punches.get(pos + 1)); punches.set(pos + 1, punch); } }
282283284285286287288
punches.set(pos, punches.get(pos + 1)); punches.set(pos + 1, punch); } } private void mutateAddPunch(ArrayList<PunchObject> punches, int pos) { punches.add(pos, new PunchObject(randomControl(0), PunchObject.NO_TIME)); }
285286287288289290291
} private void mutateAddPunch(ArrayList<PunchObject> punches, int pos) { punches.add(pos, new PunchObject(randomControl(0), PunchObject.NO_TIME)); } private void mutateSubsPunch(ArrayList<PunchObject> punches, int pos) { punches.set(pos, new PunchObject(randomControl(punches.get(pos).getCode()), PunchObject.NO_TIME)); }
320321322323324325326327328
} private ArrayList<PunchObject> normalTrace(int[] codes) { ArrayList<PunchObject> punches = new ArrayList<PunchObject>(codes.length); for (int i = 0; i < codes.length; i++) { punches.add(new PunchObject(codes[i], PunchObject.NO_TIME)); } return punches; }