Author: tn
Date: Sat Dec 14 22:07:02 2013
New Revision: 1550977

URL: http://svn.apache.org/r1550977
Log:
Formatting, use List instead of ArrayList.

Modified:
    
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/genetics/AbstractListChromosome.java
    
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/genetics/ElitisticListPopulation.java
    
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/genetics/NPointCrossover.java
    
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/genetics/OnePointCrossover.java
    
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/genetics/TournamentSelection.java

Modified: 
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/genetics/AbstractListChromosome.java
URL: 
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/genetics/AbstractListChromosome.java?rev=1550977&r1=1550976&r2=1550977&view=diff
==============================================================================
--- 
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/genetics/AbstractListChromosome.java
 (original)
+++ 
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/genetics/AbstractListChromosome.java
 Sat Dec 14 22:07:02 2013
@@ -40,7 +40,7 @@ public abstract class AbstractListChromo
      */
     public AbstractListChromosome(final List<T> representation) throws 
InvalidRepresentationException {
         checkValidity(representation);
-        this.representation = Collections.unmodifiableList(new ArrayList<T> 
(representation));
+        this.representation = Collections.unmodifiableList(new 
ArrayList<T>(representation));
     }
 
     /**

Modified: 
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/genetics/ElitisticListPopulation.java
URL: 
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/genetics/ElitisticListPopulation.java?rev=1550977&r1=1550976&r2=1550977&view=diff
==============================================================================
--- 
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/genetics/ElitisticListPopulation.java
 (original)
+++ 
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/genetics/ElitisticListPopulation.java
 Sat Dec 14 22:07:02 2013
@@ -55,7 +55,6 @@ public class ElitisticListPopulation ext
 
         super(chromosomes, populationLimit);
         setElitismRate(elitismRate);
-
     }
 
     /**
@@ -71,7 +70,6 @@ public class ElitisticListPopulation ext
 
         super(populationLimit);
         setElitismRate(elitismRate);
-
     }
 
     /**

Modified: 
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/genetics/NPointCrossover.java
URL: 
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/genetics/NPointCrossover.java?rev=1550977&r1=1550976&r2=1550977&view=diff
==============================================================================
--- 
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/genetics/NPointCrossover.java
 (original)
+++ 
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/genetics/NPointCrossover.java
 Sat Dec 14 22:07:02 2013
@@ -139,13 +139,13 @@ public class NPointCrossover<T> implemen
         final List<T> parent1Rep = first.getRepresentation();
         final List<T> parent2Rep = second.getRepresentation();
         // and of the children
-        final ArrayList<T> child1Rep = new ArrayList<T>(first.getLength());
-        final ArrayList<T> child2Rep = new ArrayList<T>(second.getLength());
+        final List<T> child1Rep = new ArrayList<T>(first.getLength());
+        final List<T> child2Rep = new ArrayList<T>(second.getLength());
 
         final RandomGenerator random = GeneticAlgorithm.getRandomGenerator();
 
-        ArrayList<T> c1 = child1Rep;
-        ArrayList<T> c2 = child2Rep;
+        List<T> c1 = child1Rep;
+        List<T> c2 = child2Rep;
 
         int remainingPoints = crossoverPoints;
         int lastIndex = 0;
@@ -160,7 +160,7 @@ public class NPointCrossover<T> implemen
             }
 
             // swap the children for the next segment
-            ArrayList<T> tmp = c1;
+            List<T> tmp = c1;
             c1 = c2;
             c2 = tmp;
 

Modified: 
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/genetics/OnePointCrossover.java
URL: 
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/genetics/OnePointCrossover.java?rev=1550977&r1=1550976&r2=1550977&view=diff
==============================================================================
--- 
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/genetics/OnePointCrossover.java
 (original)
+++ 
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/genetics/OnePointCrossover.java
 Sat Dec 14 22:07:02 2013
@@ -105,8 +105,8 @@ public class OnePointCrossover<T> implem
         final List<T> parent1Rep = first.getRepresentation();
         final List<T> parent2Rep = second.getRepresentation();
         // and of the children
-        final ArrayList<T> child1Rep = new ArrayList<T> (first.getLength());
-        final ArrayList<T> child2Rep = new ArrayList<T> (second.getLength());
+        final List<T> child1Rep = new ArrayList<T>(first.getLength());
+        final List<T> child2Rep = new ArrayList<T>(second.getLength());
 
         // select a crossover point at random (0 and length makes no sense)
         final int crossoverIndex = 1 + 
(GeneticAlgorithm.getRandomGenerator().nextInt(length-2));

Modified: 
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/genetics/TournamentSelection.java
URL: 
http://svn.apache.org/viewvc/commons/proper/math/trunk/src/main/java/org/apache/commons/math3/genetics/TournamentSelection.java?rev=1550977&r1=1550976&r2=1550977&view=diff
==============================================================================
--- 
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/genetics/TournamentSelection.java
 (original)
+++ 
commons/proper/math/trunk/src/main/java/org/apache/commons/math3/genetics/TournamentSelection.java
 Sat Dec 14 22:07:02 2013
@@ -64,7 +64,7 @@ public class TournamentSelection impleme
      * Helper for {@link #select(Population)}. Draw {@link #arity} random 
chromosomes without replacement from the
      * population, and then select the fittest chromosome among them.
      *
-     * @param population the population from which the chromosomes are choosen.
+     * @param population the population from which the chromosomes are chosen.
      * @return the selected chromosome.
      * @throws MathIllegalArgumentException if the tournament arity is bigger 
than the population size
      */


Reply via email to