forked from Gab0/japonicus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjaponicus_options.py
34 lines (32 loc) · 1.2 KB
/
japonicus_options.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
31
32
33
34
import optparse
import Settings
parser = optparse.OptionParser()
parser.add_option(
'-g', '--genetic', dest='genetic_algorithm', action='store_true', default=False
)
parser.add_option(
'-c', '--chromosome', dest='chromosome_mode', action='store_true', default=False
)
parser.add_option(
'-b', '--bayesian', dest='bayesian_optimization', action='store_true', default=False
)
parser.add_option(
'-k', '--gekko', dest='spawn_gekko', action='store_true', default=False
)
parser.add_option(
'-r', '--random', dest='random_strategy', action='store_true', default=False
)
parser.add_option('-w', '--web', dest='spawn_web', action='store_true', default=False)
parser.add_option('--repeat <x>', dest='repeater', type=int, default=1)
parser.add_option('--strat <strat>', dest='strategy', default=None)
parser.add_option('--skeleton <skeleton>', dest='skeleton', default=None)
genconf = Settings.getSettings()['generations']
for config in genconf.keys():
if type(genconf[config]) not in [dict, list, bool, tuple]:
parser.add_option(
"--%s <value>" % config,
dest=config,
type=type(genconf[config]),
default=None,
)
options, args = parser.parse_args()