-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbog.py
30 lines (21 loc) · 1023 Bytes
/
bog.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Copyright (c) 2012 Stellenbosch University
# This source code is released under the Academic Free License 3.0
# See https://github.com/gvrooyen/SocialLearning/blob/master/LICENSE for the full text of the license.
# Author: G-J van Rooyen <[email protected]>
"""
Display information about the best-of-generation individuals for the specified deme.
This script is indented to be run from the command line.
"""
import pymongo
import argparse
if __name__ == '__main__':
# Display information about the best-of-generation individuals for the specified deme
parser = argparse.ArgumentParser(description="Display information about the best-of-generation individuals for the specified deme")
parser.add_argument('-d', metavar='deme', type=str, default='default',
help="The name of the genetic programming deme")
args = parser.parse_args()
conn = pymongo.Connection()
db = conn.SocialLearning
coll = db['gp_' + args.d]
for X in coll.find():
print(X['generation'], X['BOG']['fitness'], X['BOG']['state'])