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/03/19 12:12:26 UTC
ignite git commit: IGNITE-7916: GA Grid examples should be ready for
auto run on TeamCity
Repository: ignite
Updated Branches:
refs/heads/master 6ddc6d701 -> 68502b0a6
IGNITE-7916: GA Grid examples should be ready for auto run on TeamCity
this closes #3638
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/68502b0a
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/68502b0a
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/68502b0a
Branch: refs/heads/master
Commit: 68502b0a60d92bc10cdfba11516db7e629eae2de
Parents: 6ddc6d7
Author: Turik Campbell <ad...@techbysample.com>
Authored: Mon Mar 19 15:12:15 2018 +0300
Committer: Yury Babak <yb...@gridgain.com>
Committed: Mon Mar 19 15:12:15 2018 +0300
----------------------------------------------------------------------
.../genetic/change/OptimizeMakeChangeGAExample.java | 15 ++++++++++-----
.../ml/genetic/helloworld/HelloWorldGAExample.java | 6 +++---
.../examples/ml/genetic/movie/MovieGAExample.java | 15 ++++++++++-----
3 files changed, 23 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/68502b0a/examples/src/main/java/org/apache/ignite/examples/ml/genetic/change/OptimizeMakeChangeGAExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/ml/genetic/change/OptimizeMakeChangeGAExample.java b/examples/src/main/java/org/apache/ignite/examples/ml/genetic/change/OptimizeMakeChangeGAExample.java
index ccd31cb..000424f 100644
--- a/examples/src/main/java/org/apache/ignite/examples/ml/genetic/change/OptimizeMakeChangeGAExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/ml/genetic/change/OptimizeMakeChangeGAExample.java
@@ -45,8 +45,8 @@ import org.apache.ignite.ml.genetic.parameter.GAGridConstants;
* -DAMOUNTCHANGE=75
*
* <p> Remote nodes should always be started with special configuration file which enables P2P class loading: {@code
- * 'ignite.{sh|bat} examples/config/example-ignite.xml'}.</p> <p> Alternatively you can run ExampleNodeStartup
- * in another JVM which will start node with {@code examples/config/example-ignite.xml} configuration.</p>
+ * 'ignite.{sh|bat} examples/config/example-ignite.xml'}.</p> <p> Alternatively you can run ExampleNodeStartup in
+ * another JVM which will start node with {@code examples/config/example-ignite.xml} configuration.</p>
*/
public class OptimizeMakeChangeGAExample {
@@ -68,17 +68,21 @@ public class OptimizeMakeChangeGAExample {
public static void main(String args[]) {
System.setProperty("IGNITE_QUIET", "false");
- sAmountChange = System.getProperty("AMOUNTCHANGE");
+ sAmountChange = "75";
StringBuffer sbErrorMessage = new StringBuffer();
sbErrorMessage.append("AMOUNTCHANGE System property not set. Please provide a valid value between 1 and 99. ");
sbErrorMessage.append(" ");
sbErrorMessage.append("IE: -DAMOUNTCHANGE=75");
+ sbErrorMessage.append("\n");
+ sbErrorMessage.append("Using default value: 75");
//Check if -DAMOUNTCHANGE JVM system variable is provided
- if (sAmountChange == null) {
+ if (System.getProperty("AMOUNTCHANGE") == null) {
System.out.println(sbErrorMessage);
- System.exit(1);
+ }
+ else {
+ sAmountChange = System.getProperty("AMOUNTCHANGE");
}
try {
@@ -149,6 +153,7 @@ public class OptimizeMakeChangeGAExample {
Chromosome fittestChromosome = gaGrid.evolve();
Ignition.stop(true);
+
ignite = null;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/68502b0a/examples/src/main/java/org/apache/ignite/examples/ml/genetic/helloworld/HelloWorldGAExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/ml/genetic/helloworld/HelloWorldGAExample.java b/examples/src/main/java/org/apache/ignite/examples/ml/genetic/helloworld/HelloWorldGAExample.java
index 1799480..70b00d8 100644
--- a/examples/src/main/java/org/apache/ignite/examples/ml/genetic/helloworld/HelloWorldGAExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/ml/genetic/helloworld/HelloWorldGAExample.java
@@ -28,7 +28,6 @@ import org.apache.ignite.ml.genetic.GAGrid;
import org.apache.ignite.ml.genetic.Gene;
import org.apache.ignite.ml.genetic.parameter.GAConfiguration;
-
/**
* This example demonstrates how to use the GAGrid framework.
*
@@ -42,8 +41,8 @@ import org.apache.ignite.ml.genetic.parameter.GAConfiguration;
* mvn exec:java -Dexec.mainClass="org.apache.ignite.examples.ml.genetic.helloworld.HelloWorldGAExample"
*
* <p> Remote nodes should always be started with special configuration file which enables P2P class loading: {@code
- * 'ignite.{sh|bat} examples/config/example-ignite.xml'}.</p> <p> Alternatively you can run ExampleNodeStartup
- * in another JVM which will start node with {@code examples/config/example-ignite.xml} configuration.</p>
+ * 'ignite.{sh|bat} examples/config/example-ignite.xml'}.</p> <p> Alternatively you can run ExampleNodeStartup in
+ * another JVM which will start node with {@code examples/config/example-ignite.xml} configuration.</p>
*/
public class HelloWorldGAExample {
@@ -87,6 +86,7 @@ public class HelloWorldGAExample {
Chromosome fittestChromosome = gaGrid.evolve();
Ignition.stop(true);
+
ignite = null;
}
http://git-wip-us.apache.org/repos/asf/ignite/blob/68502b0a/examples/src/main/java/org/apache/ignite/examples/ml/genetic/movie/MovieGAExample.java
----------------------------------------------------------------------
diff --git a/examples/src/main/java/org/apache/ignite/examples/ml/genetic/movie/MovieGAExample.java b/examples/src/main/java/org/apache/ignite/examples/ml/genetic/movie/MovieGAExample.java
index 79ec295..f14cb83 100644
--- a/examples/src/main/java/org/apache/ignite/examples/ml/genetic/movie/MovieGAExample.java
+++ b/examples/src/main/java/org/apache/ignite/examples/ml/genetic/movie/MovieGAExample.java
@@ -42,8 +42,8 @@ import org.apache.ignite.ml.genetic.parameter.GAGridConstants;
* mvn exec:java -Dexec.mainClass="org.apache.ignite.examples.ml.genetic.movie.MovieGAExample" -DGENRES=Action,Comedy
*
* <p> Remote nodes should always be started with special configuration file which enables P2P class loading: {@code
- * 'ignite.{sh|bat} examples/config/example-ignite.xml'}.</p> <p> Alternatively you can run ExampleNodeStartup
- * in another JVM which will start node with {@code examples/config/example-ignite.xml} configuration.</p>
+ * 'ignite.{sh|bat} examples/config/example-ignite.xml'}.</p> <p> Alternatively you can run ExampleNodeStartup in
+ * another JVM which will start node with {@code examples/config/example-ignite.xml} configuration.</p>
*/
public class MovieGAExample {
@@ -63,16 +63,21 @@ public class MovieGAExample {
System.setProperty("IGNITE_QUIET", "false");
List genres = new ArrayList();
- String sGenres = System.getProperty("GENRES");
+ String sGenres = "Action,Comedy,Romance";
StringBuffer sbErrorMessage = new StringBuffer();
sbErrorMessage.append("GENRES System property not set. Please provide GENRES information.");
sbErrorMessage.append(" ");
sbErrorMessage.append("IE: -DGENRES=Action,Comedy,Romance");
+ sbErrorMessage.append("\n");
+ sbErrorMessage.append("Using default value: Action,Comedy,Romance");
- if (sGenres == null) {
+ if (System.getProperty("GENRES") == null) {
System.out.println(sbErrorMessage);
- System.exit(1);
+
+ }
+ else {
+ sGenres = System.getProperty("GENRES");
}
StringTokenizer st = new StringTokenizer(sGenres, ",");