summaryrefslogtreecommitdiff
path: root/batch.py
diff options
context:
space:
mode:
Diffstat (limited to 'batch.py')
-rw-r--r--batch.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/batch.py b/batch.py
new file mode 100644
index 0000000..5891695
--- /dev/null
+++ b/batch.py
@@ -0,0 +1,10 @@
+# Sample batch fitness algorithm
+# fitness = sum(genes)
+# Run method: python batch.py "%s"
+
+import sys
+
+gene_lists = sys.argv[1].split(";")
+genes = map(lambda genes: map(float, genes.split(",")), gene_lists)
+fitnesses = map(sum, genes)
+print ",".join(map(str, fitnesses))