diff options
author | Leo Tenenbaum <pommicket@gmail.com> | 2017-08-16 15:11:56 -0400 |
---|---|---|
committer | Leo Tenenbaum <pommicket@gmail.com> | 2017-08-16 15:11:56 -0400 |
commit | d3dab8d06646727e94e85e1919812b68dd23cf04 (patch) | |
tree | 057ab12f678c69bb7ea735188606fad8de490d44 /batch.py | |
parent | 48ccc27302d61bbb212db462eb6e6bb100e28682 (diff) |
Initial commit
Diffstat (limited to 'batch.py')
-rw-r--r-- | batch.py | 10 |
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)) |