Here is what I just wrote:
public void mutate(){
ListIterator<Double> git = genome.listIterator();
Iterator<Double> mit = mutationStrategies.iterator();
while (git.hasNext() && mit.hasNext()){
git.set(alleleUpdate(git.next(), mit.next()));
}
}
Is this the most efficient and clear way to do this? All you need to know is that the list of genomes sets its values according to some function that takes its current value and the current value of mutationStrategies. (If you are into evolutionary material, this is an algorithm for evolutionary strategies).
source
share