summaryrefslogtreecommitdiff
path: root/src/genetic/GeneticDriver.java
diff options
context:
space:
mode:
authorScott Gasch <[email protected]>2016-06-01 18:58:58 -0700
committerScott Gasch <[email protected]>2016-06-01 18:58:58 -0700
commit3fd43cd5fcb22bb65bf2a92a25d95d801b11c9e0 (patch)
tree9b6443235d16ba17f094a1a1c7ae53d2bcb9267b /src/genetic/GeneticDriver.java
Initial checkin for typhoon chess engine.
Diffstat (limited to 'src/genetic/GeneticDriver.java')
-rw-r--r--src/genetic/GeneticDriver.java40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/genetic/GeneticDriver.java b/src/genetic/GeneticDriver.java
new file mode 100644
index 0000000..5c09b03
--- /dev/null
+++ b/src/genetic/GeneticDriver.java
@@ -0,0 +1,40 @@
+/*
+ Copyright 2007 Scott Gasch
+
+ Licensed 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.guru.wannabe.genetic;
+
+public class GeneticDriver {
+ public static final int numGenerations = 5;
+ public static final int numPerGeneration = 32;
+
+ public static void main(String[] args) {
+ System.out.println("---BEGIN: Genetic simulation.");
+ GeneticProcess process = new ParallelChessGeneticProcess();
+ if (!process.mainInitialize(numGenerations, numPerGeneration)) {
+ throw new AssertionError("process.mainInitialize failed.");
+ }
+ for (int currentGeneration = 0;
+ currentGeneration < numGenerations;
+ currentGeneration++) {
+ System.out.println("---BEGIN: Generation " + currentGeneration);
+ process.generationInitialize(currentGeneration);
+ process.generationEvaluation(currentGeneration);
+ process.generationReproduction(currentGeneration);
+ System.out.println("---END: Generation " + currentGeneration);
+ }
+ System.out.println("---END: Genetic simulation.");
+ }
+}