/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.jenetics.example.image;

import java.util.ListIterator;

import org.jenetics.Mutator;
import org.jenetics.util.MSeq;

/**
 * Polygon mutator class.
 *
 * @param <C> the fitness type
 */
public class PolygonMutator<C extends Comparable<? super C>>
	extends Mutator<PolygonGene, C>
{

	private final double _mutationRate;
	private final double _mutationAmount;

	public PolygonMutator(final double mutationRate, final double mutationAmount) {
		super(1.0);
		_mutationRate = mutationRate;
		_mutationAmount = mutationAmount;
	}

	@Override
	protected int mutate(final MSeq<PolygonGene> genes, final double p) {
		final ListIterator<PolygonGene> it = genes.listIterator();

		while (it.hasNext()) {
			final PolygonGene gene = it.next();
			final PolygonGene mutated = gene.newInstance(
				gene.getAllele().mutate(_mutationRate, _mutationAmount)
			);
			it.set(mutated);
		}

		return genes.size();
	}

}

@@ -1110,25 +1110,16 @@
 nal 
-double _mutationR
+float _r
 ate;
@@ -1138,30 +1138,24 @@
 nal 
-double _mutationAmount
+float _magnitude
 ;%0A%0A%09
@@ -1186,140 +1186,99 @@
 nal 
-double mutationRate, final double mutationAmount) %7B%0A%09%09super(1.0);%0A%09%09_mutationRate = mutationRate;%0A%09%09_mutationAmount = mutationAmount
+float rate, final float magnitude) %7B%0A%09%09super(1.0);%0A%09%09_rate = rate;%0A%09%09_magnitude = magnitude
 ;%0A%09%7D
@@ -1569,37 +1569,24 @@
 te(_
-mutationRate, _mutationAmount
+rate, _magnitude
 )%0A%09%09

Simplify field names.