|
@@ -26,14 +26,15 @@ subparsers = parser.add_subparsers(help='sub-commands help')
|
26
|
26
|
parser_evolve = subparsers.add_parser('evolve', help='evolving help')
|
27
|
27
|
|
28
|
28
|
parser_evolve.add_argument('--steps', '-s', type=int, metavar='N',
|
29
|
|
- default=4000, help="Number of steps")
|
|
29
|
+ default=30000, help="Number of steps")
|
30
|
30
|
|
31
|
|
-parser_evolve.add_argument('--repeat-eval', type=int, metavar='N', default=5)
|
|
31
|
+parser_evolve.add_argument('--repeat-eval', '-R', type=int, metavar='N',
|
|
32
|
+ default=5)
|
32
|
33
|
|
33
|
34
|
parser_evolve.add_argument('--world-height', '-y', type=int, metavar='HEIGHT',
|
34
|
|
- default=256)
|
|
35
|
+ default=512)
|
35
|
36
|
parser_evolve.add_argument('--world-width', '-x', type=int, metavar='WIDTH',
|
36
|
|
- default=256)
|
|
37
|
+ default=512)
|
37
|
38
|
|
38
|
39
|
parser_evolve.add_argument('--turmit-count', '-T', type=int, metavar='N',
|
39
|
40
|
default=3)
|
|
@@ -63,18 +64,20 @@ parser_evolve.add_argument('--log-progs', '-L', type=str, metavar='FILENAME',
|
63
|
64
|
parser_evolve.add_argument('--quiet', '-q', action='store_const',
|
64
|
65
|
default=False, const=True)
|
65
|
66
|
|
|
67
|
+
|
|
68
|
+
|
66
|
69
|
parser_gen = subparsers.add_parser('generate', help='evolving help')
|
67
|
70
|
|
68
|
71
|
parser_gen.add_argument('--prog', '-P', type=str, default=None)
|
69
|
72
|
parser_gen.add_argument('--output', '-o', type=str, default='gte.png')
|
70
|
73
|
parser_gen.add_argument('--world-height', '-y', type=int, metavar='HEIGHT',
|
71
|
|
- default=256)
|
|
74
|
+ default=512)
|
72
|
75
|
parser_gen.add_argument('--world-width', '-x', type=int, metavar='WIDTH',
|
73
|
|
- default=256)
|
|
76
|
+ default=512)
|
74
|
77
|
parser_gen.add_argument('--turmit-count', '-T', type=int, metavar='N',
|
75
|
|
- default=10)
|
|
78
|
+ default=3)
|
76
|
79
|
parser_gen.add_argument('--steps', '-s', type=int, metavar='N',
|
77
|
|
- default=1024)
|
|
80
|
+ default=30000)
|
78
|
81
|
|
79
|
82
|
|
80
|
83
|
args = parser.parse_args()
|
|
@@ -113,7 +116,7 @@ if 'pool_size' in args:
|
113
|
116
|
works = []
|
114
|
117
|
for pid, prog in enumerate(progs):
|
115
|
118
|
for i in range(args.repeat_eval):
|
116
|
|
- works.append((pid, prog, i, args))
|
|
119
|
+ works.append((generation, pid, prog, i, args))
|
117
|
120
|
res = pool.imap(eval_prog, works)
|
118
|
121
|
scores = [0 for _ in range(len(progs))]
|
119
|
122
|
for pid, score in res:
|
|
@@ -158,9 +161,10 @@ else:
|
158
|
161
|
start = time.time()
|
159
|
162
|
for step in range(args.steps):
|
160
|
163
|
if step % 512 == 1:
|
161
|
|
- msg = 'Step %d/%d %dus/step'
|
|
164
|
+ msg = 'Step %d/%d %dus/step fractdim=%.3f'
|
162
|
165
|
msg %= (step, args.steps,
|
163
|
|
- ((time.time() - start)*1000000)//step//len(turmits))
|
|
166
|
+ ((time.time() - start)*1000000)//step//len(turmits),
|
|
167
|
+ w.fractdim())
|
164
|
168
|
logger.info(msg)
|
165
|
169
|
for turmit in turmits:
|
166
|
170
|
turmit()
|