Browse Source

Add optionnal variable step count

Yann Weber 6 years ago
parent
commit
6b1e0a7f26
2 changed files with 6 additions and 1 deletions
  1. 5
    0
      gte/__main__.py
  2. 1
    1
      gte/world.py

+ 5
- 0
gte/__main__.py View File

@@ -60,10 +60,15 @@ parser_evolve.add_argument('--max-generation', '-G', type=int, metavar='N',
60 60
 
61 61
 parser_evolve.add_argument('--log-progs', '-L', type=str, metavar='FILENAME',
62 62
                            default=None)
63
+
63 64
 parser_evolve.add_argument('--exp-mutate', '-E', action='store_const',
64 65
                            default=False, const=True,
65 66
                            help="If True make 2**copy_num mutation")
66 67
 
68
+parser_evolve.add_argument('--mod-steps', '-M', action='store_const',
69
+                           default=False, const=True,
70
+                           help="If True make steps change given try number")
71
+
67 72
 parser_evolve.add_argument('--quiet', '-q', action='store_const',
68 73
                            default=False, const=True)
69 74
 

+ 1
- 1
gte/world.py View File

@@ -23,7 +23,7 @@ def eval_prog(args):
23 23
                for _ in range(args.turmit_count)]
24 24
 
25 25
     start = time.time()
26
-    if trynum == 0:
26
+    if not args.mod_steps or trynum == 0:
27 27
         steps = args.steps
28 28
     else:
29 29
         steps = args.steps - int((args.steps / 1.5) // (args.repeat_eval - trynum))

Loading…
Cancel
Save