-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjob_generator.py
38 lines (28 loc) · 1.12 KB
/
job_generator.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
35
36
37
38
import json
def generate_job(char_time =3.5,amplitude =0.1,
job_file='job.json', puff_release_rate = 10, puff_spread_rate =0.003,
detect_threshold = 500, flight_speed = 200, puff_mol_amount = 1,
t_max =75., dt = 0.01,num_it =1, base_duration =0.2):
const_dict={}
#simulation
const_dict['num_it'] = num_it
const_dict['t_max']= t_max
const_dict['dt'] = dt
#wind meandering
const_dict['char_time'] = char_time
const_dict['amplitude'] = amplitude
#plume source
const_dict['puff_release_rate'] = puff_release_rate
const_dict['puff_spread_rate'] = puff_spread_rate
const_dict['puff_mol_amount'] = puff_mol_amount
#navigators
const_dict['x_start'] = 100
const_dict['y_start'] = 500
const_dict['nav_type'] = 'alex'
const_dict['wait_type'] = 1
const_dict['base_turn_angle'] = 18 #for crw
const_dict['threshold'] = detect_threshold
const_dict['duration'] = base_duration
const_dict['speed'] = flight_speed
with open(job_file, 'w') as outfile:
json.dump(const_dict, outfile)