better output

master
chen 4 years ago
parent b3531136e5
commit c135cb862b

@ -30,6 +30,7 @@ def read_stat(statfile, df=None):
return df5
else:
df.loc[len(df)] = df5.loc[2]
#print(df5.loc[2])
return df
@ -37,7 +38,8 @@ def readall(path):
for f in os.listdir(path):
if f.endswith('.stat'):
statfile = f_dir+'\\'+f
if f.endswith('0.stat'):
#print(statfile)
if f.endswith('00.stat'):
df = read_stat(statfile)
out_file = f[:-7]+'-r.csv'
continue

@ -3,7 +3,7 @@ import random
import datetime
import json
work_dir = 'Z:\\share\\workspace\\pycharm\\lrmodel\\jammerDetect'
work_dir = 'Z:\\share\\workspace\\pycharm\\jam_det\\jammerDetect'
nodes_file = '.\\jammerDetect.nodes'
app_file = 'jammerDetect.app'
basic = [[500, 550, 0], [500, 400, 0], [600, 550, 0], [600, 400, 0], [700, 400, 0]]
@ -31,7 +31,7 @@ def run(name):
def gen_loc():
loc = [[0, 0, 0] for i in range(5)]
for i in range(5):
for i in range(2):
b0 = random.randint(scop[0], scop[1])
b1 = random.randint(scop[0], scop[1])
loc[i][0] = basic[i][0] + b0
@ -55,7 +55,7 @@ def show_dis(locations):
return diss
def test(name):
def experiment(name):
l = gen_loc()
print(l)
diss = show_dis(l)
@ -70,9 +70,9 @@ if __name__ == '__main__':
DATA.append(basic)
DATA.append(scop)
for i in range(2):
name = time_str+f'-{i}'
test(name)
for i in range(50):
name = time_str+f'-{str(i).zfill(2)}'
experiment(name)
with open(time_str, 'w', encoding='utf-8') as f:
json.dump(DATA, f)

Loading…
Cancel
Save