summaryrefslogtreecommitdiff
path: root/batch.py
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2017-08-16 15:11:56 -0400
committerLeo Tenenbaum <pommicket@gmail.com>2017-08-16 15:11:56 -0400
commitd3dab8d06646727e94e85e1919812b68dd23cf04 (patch)
tree057ab12f678c69bb7ea735188606fad8de490d44 /batch.py
parent48ccc27302d61bbb212db462eb6e6bb100e28682 (diff)
Initial commit
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))