You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ch...@apache.org on 2018/04/25 17:18:10 UTC

[2/3] ignite git commit: IGNITE-8181: Broken javadoc in GA Grid

IGNITE-8181: Broken javadoc in GA Grid

this closes #3776

(cherry picked from commit 5b8d43d)


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8186a89a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8186a89a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8186a89a

Branch: refs/heads/ignite-2.5
Commit: 8186a89a12bed5c9f386c16f2c8123d2f4573742
Parents: f2c5f11
Author: YuriBabak <y....@gmail.com>
Authored: Mon Apr 9 15:22:03 2018 +0300
Committer: Yury Babak <yb...@gridgain.com>
Committed: Wed Apr 25 20:17:46 2018 +0300

----------------------------------------------------------------------
 .../ml/genetic/TruncateSelectionTask.java       | 51 +++++++++-----------
 .../ml/genetic/functions/GAGridFunction.java    | 26 +++++-----
 2 files changed, 35 insertions(+), 42 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/8186a89a/modules/ml/src/main/java/org/apache/ignite/ml/genetic/TruncateSelectionTask.java
----------------------------------------------------------------------
diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/genetic/TruncateSelectionTask.java b/modules/ml/src/main/java/org/apache/ignite/ml/genetic/TruncateSelectionTask.java
index ee7d260..d017741 100644
--- a/modules/ml/src/main/java/org/apache/ignite/ml/genetic/TruncateSelectionTask.java
+++ b/modules/ml/src/main/java/org/apache/ignite/ml/genetic/TruncateSelectionTask.java
@@ -42,31 +42,30 @@ import org.apache.ignite.ml.genetic.parameter.GAGridConstants;
  * Responsible for performing truncate selection.
  */
 public class TruncateSelectionTask extends ComputeTaskAdapter<List<Long>, Boolean> {
-    /** Ignite resource */
+    /** Ignite resource. */
     @IgniteInstanceResource
     private Ignite ignite = null;
 
-    /** fittest keys */
+    /** Fittest keys. */
     private List<Long> fittestKeys = null;
 
-    /** number of Copies */
-    private int numberOfCopies = 0;
+    /** Number of Copies. */
+    private int numOfCopies = 0;
 
     /**
-     * @param config GAConfiguration
-     * @param fittestKeys List of long
-     * @param numberOfCopies Number of Copies
+     * @param fittestKeys List of long.
+     * @param numOfCopies Number of Copies.
      */
-    public TruncateSelectionTask(List<Long> fittestKeys, int numberOfCopies) {
+    public TruncateSelectionTask(List<Long> fittestKeys, int numOfCopies) {
         this.fittestKeys = fittestKeys;
-        this.numberOfCopies = numberOfCopies;
+        this.numOfCopies = numOfCopies;
     }
 
     /**
-     * Retrieve a chromosome
+     * Retrieve a chromosome.
      *
-     * @param key Primary key of chromosome
-     * @return Chromosome
+     * @param key Primary key of chromosome.
+     * @return Chromosome.
      */
     private Chromosome getChromosome(Long key) {
         IgniteCache<Long, Chromosome> cache = ignite.cache(GAGridConstants.POPULATION_CACHE);
@@ -81,25 +80,23 @@ public class TruncateSelectionTask extends ComputeTaskAdapter<List<Long>, Boolea
 
         try (QueryCursor<Entry<Long, Chromosome>> cursor = cache.query(sql)) {
             for (Entry<Long, Chromosome> e : cursor)
-                chromosome = (e.getValue())
-
-                    ;
+                chromosome = (e.getValue());
         }
 
         return chromosome;
     }
 
     /**
-     * Return a List of lists containing keys
+     * Return a List of lists containing keys.
      *
-     * @return List of lists containing keys
+     * @return List of lists containing keys.
      */
     private List<List<Long>> getEnhancedPopulation() {
         List<List<Long>> list = new ArrayList<List<Long>>();
 
         for (Long key : fittestKeys) {
             Chromosome copy = getChromosome(key);
-            for (int i = 0; i < numberOfCopies; i++) {
+            for (int i = 0; i < numOfCopies; i++) {
                 long[] thegenes = copy.getGenes();
                 List<Long> geneList = new ArrayList<Long>();
                 for (int k = 0; k < copy.getGenes().length; k++) {
@@ -113,9 +110,9 @@ public class TruncateSelectionTask extends ComputeTaskAdapter<List<Long>, Boolea
     }
 
     /**
-     * @param nodes List of ClusterNode
-     * @param chromosomeKeys Primary keys for respective chromosomes
-     * @return Map of nodes to jobs
+     * @param nodes List of ClusterNode.
+     * @param chromosomeKeys Primary keys for respective chromosomes.
+     * @return Map of nodes to jobs.
      */
     public Map map(List<ClusterNode> nodes, List<Long> chromosomeKeys) throws IgniteException {
         Map<ComputeJob, ClusterNode> map = new HashMap<>();
@@ -132,23 +129,22 @@ public class TruncateSelectionTask extends ComputeTaskAdapter<List<Long>, Boolea
             k = k + 1;
         }
         return map;
-
     }
 
     /**
      * We return TRUE if success, else Exception is thrown.
      *
-     * @param list List of ComputeJobResult
-     * @return Boolean value
+     * @param list List of ComputeJobResult.
+     * @return Boolean value.
      */
     public Boolean reduce(List<ComputeJobResult> list) throws IgniteException {
         return Boolean.TRUE;
     }
 
     /**
-     * @param res ComputeJobResult
-     * @param rcvd List of ComputeJobResult
-     * @return ComputeJobResultPolicy
+     * @param res ComputeJobResult.
+     * @param rcvd List of ComputeJobResult.
+     * @return ComputeJobResultPolicy.
      */
     public ComputeJobResultPolicy result(ComputeJobResult res, List<ComputeJobResult> rcvd) {
         IgniteException err = res.getException();
@@ -158,7 +154,6 @@ public class TruncateSelectionTask extends ComputeTaskAdapter<List<Long>, Boolea
 
         // If there is no exception, wait for all job results.
         return ComputeJobResultPolicy.WAIT;
-
     }
 
 }

http://git-wip-us.apache.org/repos/asf/ignite/blob/8186a89a/modules/ml/src/main/java/org/apache/ignite/ml/genetic/functions/GAGridFunction.java
----------------------------------------------------------------------
diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/genetic/functions/GAGridFunction.java b/modules/ml/src/main/java/org/apache/ignite/ml/genetic/functions/GAGridFunction.java
index b3e4fed..d28bc02 100644
--- a/modules/ml/src/main/java/org/apache/ignite/ml/genetic/functions/GAGridFunction.java
+++ b/modules/ml/src/main/java/org/apache/ignite/ml/genetic/functions/GAGridFunction.java
@@ -32,20 +32,18 @@ import org.apache.ignite.ml.genetic.parameter.GAConfiguration;
 import org.apache.ignite.ml.genetic.utils.GAGridUtils;
 
 /**
- * Responsible for providing custom SQL functions to retrieve optimization results
+ * Responsible for providing custom SQL functions to retrieve optimization results.
  */
 public class GAGridFunction {
-     /**
-     * @param config GA Configuration
-     */
+     /** */
     public GAGridFunction() {
     }
 
     /**
-     * Retrieve solutions in descending order based on fitness score
+     * Retrieve solutions in descending order based on fitness score.
      *
-     * @return Result set
-     * @throws SQLException
+     * @return Result set.
+     * @throws SQLException If failed.
      */
     @QuerySqlFunction
     public static SimpleResultSet getSolutionsDesc() {
@@ -53,10 +51,10 @@ public class GAGridFunction {
     }
 
     /**
-     * Retrieve solutions in ascending order based on fitness score
+     * Retrieve solutions in ascending order based on fitness score.
      *
      * @return Result set
-     * @throws SQLException
+     * @throws SQLException If failed.
      */
     @QuerySqlFunction
     public static SimpleResultSet getSolutionsAsc() throws SQLException {
@@ -64,11 +62,11 @@ public class GAGridFunction {
     }
 
     /**
-     * Retrieve and individual solution by Chromosome key
+     * Retrieve and individual solution by Chromosome key.
      *
-     * @param key Primary key of Chromosome
-     * @return SimpleResultSet
-     * @throws SQLException
+     * @param key Primary key of Chromosome.
+     * @return SimpleResultSet.
+     * @throws SQLException If failed.
      */
     @QuerySqlFunction
     public static SimpleResultSet getSolutionById(int key) throws SQLException {
@@ -81,7 +79,7 @@ public class GAGridFunction {
     }
 
     /**
-     * Helper routine to return 'pivoted' results using the provided query param
+     * Helper routine to return 'pivoted' results using the provided query param.
      *
      * @param query Sql
      * @return Result set