-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathprog_tank.py
734 lines (438 loc) · 20.6 KB
/
prog_tank.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
'''
@author: ANIK
'''
from multiprocessing import freeze_support
import multiprocessing
import time
from z3 import *
from z3.z3 import ForAll
# set_param('parallel.enable', True)
set_option(rational_to_decimal = True)
def prog_tanks_pressure(eps, sigDur, segCount):
# initialize z3 solver
s = Solver()
# ===== VAR INIT START ===== #
t0 = 0.00 # First time-stamp on agent that is to be re-timed
t1 = 0.05 # Second time-stamp on agent that is to be re-timed
if sigDur / segCount < t1:
segCount = sigDur / t1
if t0 != 0:
return
segmentDuration = sigDur / segCount
delta = 0
nSAT = 1 # Number of SAT assignments the solver will display per segment; set to -1 for allSAT
# multiplier adjustments
multiplier = 1 / t1
eps *= multiplier
segmentDuration *= multiplier
sigDur *= multiplier
# ===== VAR INIT END ===== #
# ===== READ DATA START ===== #
data_0 = getDataTank(0)
data_1 = getDataTank(1)
i = 0
solvers = []
entryFound = True
while(entryFound):
# Flag to be set True if at least one entry is found in the current iteration
entryFound = False
# Initialize solver
s = Solver()
# Calculate upper and lower time bound for current segment
segmentLowerBound = int((i * segmentDuration) - eps)
segmentUpperBound = int((i + 1) * segmentDuration)
timestamps0 = []
tank0 = Function('tank0', IntSort(), RealSort())
for j in range ((segmentLowerBound + 0), (segmentUpperBound + 1)):
if(j >= 0 and j < len(data_0)):
timestamps0.append(int(data_0[j][0] * multiplier))
s.add(tank0(int(data_0[j][0] * multiplier)) == data_0[j][1])
if(int(data_0[j][0] * multiplier) > (i * segmentDuration)):
entryFound = True
if data_0[j][0] * multiplier == sigDur:
entryFound = False
timestamps1 = []
tank1 = Function('tank1', IntSort(), RealSort())
for j in range ((segmentLowerBound + 0), (segmentUpperBound + 1)):
if(j >= 0 and j < len(data_1)):
timestamps1.append(int(data_1[j][0] * multiplier))
s.add(tank1(int(data_1[j][0] * multiplier)) == data_1[j][1])
if(int(data_1[j][0] * multiplier) > (i * segmentDuration)):
entryFound = True
if data_1[j][0] * multiplier == sigDur:
entryFound = False
i += 1
# force terminate after one loop
entryFound = False
# ===== READ DATA END ===== #
# ===== CONCUT FLOW START ===== #
# global clock to local clock mappings
c0 = Function('c0', IntSort(), IntSort())
s.add(And([Or([c0(i) == ((i - eps) + j) for j in range(2 * int(eps) + 1)]) for i in range(timestamps0[0], timestamps0[-1] + 1)]))
s.add(Not(Or(c0(timestamps0[0]) == timestamps0[0] - 1, c0(timestamps0[-1]) == timestamps0[-1] + 1)))
c1 = Function('c1', IntSort(), IntSort())
s.add(And([Or([c1(i) == ((i - eps) + j) for j in range(2 * int(eps) + 1)]) for i in range(timestamps1[0], timestamps1[-1] + 1)]))
s.add(Not(Or(c1(timestamps1[0]) == timestamps1[0] - 1, c1(timestamps1[-1]) == timestamps1[-1] + 1)))
# local clocks are bound by epsilon
s.add(And([And(c0(i) - c1(i) <= eps, c0(i) - c1(i) >= -eps) for i in range(timestamps0[0], timestamps0[-1] + 1)]))
# global clock to local clock mappings are ordered
s.add(And([And([Implies(i <= j, And(c0(i) <= c0(j), c1(i) <= c1(j))) for j in range(timestamps0[0], timestamps0[-1] + 1)]) for i in range(timestamps0[0], timestamps0[-1] + 1)]))
# consistent cut flow
c_flow = Function('c_flow', IntSort(), RealSort())
# c_flow = Function('c_flow', IntSort(), IntSort())
# addition
s.add(And([c_flow(i) == (tank0(c0(i)) + tank1(c1(i))) for i in range(timestamps0[0], timestamps0[-1] + 1)]))
# violation check
v = Real('v')
s.add(And(v >= timestamps0[0], v <= timestamps0[-1]))
s.add(ForAll(v, Implies(And(v >= timestamps0[0], v <= timestamps0[-1]), z3Interpolate(c_flow, v) >= 10)))
# s.add(z3Interpolate(c_flow, v) == 15)
# s.add(v == 10)
start = time.time()
if s.check() == sat:
m = s.model()
# out = "%s %s" % (m[test], m[test2])
# print(m)
end = time.time()
# else:
#
# print("unsat")
s.reset()
dur = end - start
return dur
def prog_tanks_pressure_3(eps, sigDur, segCount):
# initialize z3 solver
s = Solver()
# ===== VAR INIT START ===== #
t0 = 0.00 # First time-stamp on agent that is to be re-timed
t1 = 0.05 # Second time-stamp on agent that is to be re-timed
if sigDur / segCount < t1:
segCount = sigDur / t1
if t0 != 0:
return
segmentDuration = sigDur / segCount
delta = 0
nSAT = 1 # Number of SAT assignments the solver will display per segment; set to -1 for allSAT
# multiplier adjustments
multiplier = 1 / t1
eps *= multiplier
segmentDuration *= multiplier
sigDur *= multiplier
# ===== VAR INIT END ===== #
# ===== READ DATA START ===== #
data_0 = getDataTank(0)
data_1 = getDataTank(1)
data_2 = getDataTank(2)
i = 0
solvers = []
entryFound = True
while(entryFound):
# Flag to be set True if at least one entry is found in the current iteration
entryFound = False
# Initialize solver
s = Solver()
# Calculate upper and lower time bound for current segment
segmentLowerBound = int((i * segmentDuration) - eps)
segmentUpperBound = int((i + 1) * segmentDuration)
timestamps0 = []
tank0 = Function('tank0', IntSort(), RealSort())
for j in range ((segmentLowerBound + 0), (segmentUpperBound + 1)):
if(j >= 0 and j < len(data_0)):
timestamps0.append(int(data_0[j][0] * multiplier))
s.add(tank0(int(data_0[j][0] * multiplier)) == data_0[j][1])
if(int(data_0[j][0] * multiplier) > (i * segmentDuration)):
entryFound = True
if data_0[j][0] * multiplier == sigDur:
entryFound = False
timestamps1 = []
tank1 = Function('tank1', IntSort(), RealSort())
for j in range ((segmentLowerBound + 0), (segmentUpperBound + 1)):
if(j >= 0 and j < len(data_1)):
timestamps1.append(int(data_1[j][0] * multiplier))
s.add(tank1(int(data_1[j][0] * multiplier)) == data_1[j][1])
if(int(data_1[j][0] * multiplier) > (i * segmentDuration)):
entryFound = True
if data_1[j][0] * multiplier == sigDur:
entryFound = False
timestamps2 = []
tank2 = Function('tank2', IntSort(), RealSort())
for j in range ((segmentLowerBound + 0), (segmentUpperBound + 1)):
if(j >= 0 and j < len(data_2)):
timestamps2.append(int(data_2[j][0] * multiplier))
s.add(tank2(int(data_2[j][0] * multiplier)) == data_2[j][1])
if(int(data_2[j][0] * multiplier) > (i * segmentDuration)):
entryFound = True
if data_2[j][0] * multiplier == sigDur:
entryFound = False
i += 1
# force terminate after one loop
entryFound = False
# ===== READ DATA END ===== #
# ===== CONCUT FLOW START ===== #
# global clock to local clock mappings
c0 = Function('c0', IntSort(), IntSort())
s.add(And([Or([c0(i) == ((i - eps) + j) for j in range(2 * int(eps) + 1)]) for i in range(timestamps0[0], timestamps0[-1] + 1)]))
s.add(Not(Or(c0(timestamps0[0]) == timestamps0[0] - 1, c0(timestamps0[-1]) == timestamps0[-1] + 1)))
c1 = Function('c1', IntSort(), IntSort())
s.add(And([Or([c1(i) == ((i - eps) + j) for j in range(2 * int(eps) + 1)]) for i in range(timestamps1[0], timestamps1[-1] + 1)]))
s.add(Not(Or(c1(timestamps1[0]) == timestamps1[0] - 1, c1(timestamps1[-1]) == timestamps1[-1] + 1)))
c2 = Function('c2', IntSort(), IntSort())
s.add(And([Or([c2(i) == ((i - eps) + j) for j in range(2 * int(eps) + 1)]) for i in range(timestamps2[0], timestamps2[-1] + 1)]))
s.add(Not(Or(c2(timestamps2[0]) == timestamps2[0] - 1, c2(timestamps2[-1]) == timestamps2[-1] + 1)))
# local clocks are bound by epsilon
s.add(And([And(c0(i) - c1(i) <= eps, c0(i) - c1(i) >= -eps) for i in range(timestamps0[0], timestamps0[-1] + 1)]))
s.add(And([And(c1(i) - c2(i) <= eps, c1(i) - c2(i) >= -eps) for i in range(timestamps1[0], timestamps1[-1] + 1)]))
s.add(And([And(c2(i) - c0(i) <= eps, c2(i) - c0(i) >= -eps) for i in range(timestamps2[0], timestamps2[-1] + 1)]))
# global clock to local clock mappings are ordered
s.add(And([And([Implies(i <= j, And(c0(i) <= c0(j), c1(i) <= c1(j), c2(i) <= c2(j))) for j in range(timestamps0[0], timestamps0[-1] + 1)]) for i in range(timestamps0[0], timestamps0[-1] + 1)]))
# consistent cut flow
c_flow = Function('c_flow', IntSort(), RealSort())
# c_flow = Function('c_flow', IntSort(), IntSort())
# addition
s.add(And([c_flow(i) == (tank0(c0(i)) + tank1(c1(i)) + tank2(c2(i))) for i in range(timestamps0[0], timestamps0[-1] + 1)]))
# violation check
v = Real('v')
s.add(And(v >= timestamps0[0], v <= timestamps0[-1]))
s.add(ForAll(v, Implies(And(v >= timestamps0[0], v <= timestamps0[-1]), z3Interpolate(c_flow, v) >= 15)))
# s.add(z3Interpolate(c_flow, v) == 15)
# s.add(v == 10)
start = time.time()
if s.check() == sat:
m = s.model()
# out = "%s %s" % (m[test], m[test2])
# print(m)
end = time.time()
# else:
#
# print("unsat")
s.reset()
dur = end - start
return dur
def prog_tanks_pressure_4(eps, sigDur, segCount):
# initialize z3 solver
s = Solver()
# ===== VAR INIT START ===== #
t0 = 0.00 # First time-stamp on agent that is to be re-timed
t1 = 0.05 # Second time-stamp on agent that is to be re-timed
if sigDur / segCount < t1:
segCount = sigDur / t1
if t0 != 0:
return
segmentDuration = sigDur / segCount
delta = 0
nSAT = 1 # Number of SAT assignments the solver will display per segment; set to -1 for allSAT
# multiplier adjustments
multiplier = 1 / t1
eps *= multiplier
segmentDuration *= multiplier
sigDur *= multiplier
# ===== VAR INIT END ===== #
# ===== READ DATA START ===== #
data_0 = getDataTank(0)
data_1 = getDataTank(1)
data_2 = getDataTank(2)
data_3 = getDataTank(3)
i = 0
solvers = []
entryFound = True
while(entryFound):
# Flag to be set True if at least one entry is found in the current iteration
entryFound = False
# Initialize solver
s = Solver()
# Calculate upper and lower time bound for current segment
segmentLowerBound = int((i * segmentDuration) - eps)
segmentUpperBound = int((i + 1) * segmentDuration)
timestamps0 = []
tank0 = Function('tank0', IntSort(), RealSort())
for j in range ((segmentLowerBound + 0), (segmentUpperBound + 1)):
if(j >= 0 and j < len(data_0)):
timestamps0.append(int(data_0[j][0] * multiplier))
s.add(tank0(int(data_0[j][0] * multiplier)) == data_0[j][1])
if(int(data_0[j][0] * multiplier) > (i * segmentDuration)):
entryFound = True
if data_0[j][0] * multiplier == sigDur:
entryFound = False
timestamps1 = []
tank1 = Function('tank1', IntSort(), RealSort())
for j in range ((segmentLowerBound + 0), (segmentUpperBound + 1)):
if(j >= 0 and j < len(data_1)):
timestamps1.append(int(data_1[j][0] * multiplier))
s.add(tank1(int(data_1[j][0] * multiplier)) == data_1[j][1])
if(int(data_1[j][0] * multiplier) > (i * segmentDuration)):
entryFound = True
if data_1[j][0] * multiplier == sigDur:
entryFound = False
timestamps2 = []
tank2 = Function('tank2', IntSort(), RealSort())
for j in range ((segmentLowerBound + 0), (segmentUpperBound + 1)):
if(j >= 0 and j < len(data_2)):
timestamps2.append(int(data_2[j][0] * multiplier))
s.add(tank2(int(data_2[j][0] * multiplier)) == data_2[j][1])
if(int(data_2[j][0] * multiplier) > (i * segmentDuration)):
entryFound = True
if data_2[j][0] * multiplier == sigDur:
entryFound = False
timestamps3 = []
tank3 = Function('tank3', IntSort(), RealSort())
for j in range ((segmentLowerBound + 0), (segmentUpperBound + 1)):
if(j >= 0 and j < len(data_3)):
timestamps3.append(int(data_3[j][0] * multiplier))
s.add(tank3(int(data_3[j][0] * multiplier)) == data_3[j][1])
if(int(data_3[j][0] * multiplier) > (i * segmentDuration)):
entryFound = True
if data_3[j][0] * multiplier == sigDur:
entryFound = False
i += 1
# force terminate after one loop
entryFound = False
# ===== READ DATA END ===== #
# ===== CONCUT FLOW START ===== #
# global clock to local clock mappings
c0 = Function('c0', IntSort(), IntSort())
s.add(And([Or([c0(i) == ((i - eps) + j) for j in range(2 * int(eps) + 1)]) for i in range(timestamps0[0], timestamps0[-1] + 1)]))
s.add(Not(Or(c0(timestamps0[0]) == timestamps0[0] - 1, c0(timestamps0[-1]) == timestamps0[-1] + 1)))
c1 = Function('c1', IntSort(), IntSort())
s.add(And([Or([c1(i) == ((i - eps) + j) for j in range(2 * int(eps) + 1)]) for i in range(timestamps1[0], timestamps1[-1] + 1)]))
s.add(Not(Or(c1(timestamps1[0]) == timestamps1[0] - 1, c1(timestamps1[-1]) == timestamps1[-1] + 1)))
c2 = Function('c2', IntSort(), IntSort())
s.add(And([Or([c2(i) == ((i - eps) + j) for j in range(2 * int(eps) + 1)]) for i in range(timestamps2[0], timestamps2[-1] + 1)]))
s.add(Not(Or(c2(timestamps2[0]) == timestamps2[0] - 1, c2(timestamps2[-1]) == timestamps2[-1] + 1)))
c3 = Function('c3', IntSort(), IntSort())
s.add(And([Or([c3(i) == ((i - eps) + j) for j in range(2 * int(eps) + 1)]) for i in range(timestamps3[0], timestamps3[-1] + 1)]))
s.add(Not(Or(c3(timestamps3[0]) == timestamps3[0] - 1, c3(timestamps3[-1]) == timestamps3[-1] + 1)))
# local clocks are bound by epsilon
s.add(And([And(c0(i) - c1(i) <= eps, c0(i) - c1(i) >= -eps) for i in range(timestamps0[0], timestamps0[-1] + 1)]))
s.add(And([And(c1(i) - c2(i) <= eps, c1(i) - c2(i) >= -eps) for i in range(timestamps1[0], timestamps1[-1] + 1)]))
s.add(And([And(c2(i) - c0(i) <= eps, c2(i) - c0(i) >= -eps) for i in range(timestamps2[0], timestamps2[-1] + 1)]))
s.add(And([And(c0(i) - c3(i) <= eps, c0(i) - c3(i) >= -eps) for i in range(timestamps3[0], timestamps3[-1] + 1)]))
s.add(And([And(c1(i) - c3(i) <= eps, c1(i) - c3(i) >= -eps) for i in range(timestamps3[0], timestamps3[-1] + 1)]))
s.add(And([And(c2(i) - c3(i) <= eps, c2(i) - c3(i) >= -eps) for i in range(timestamps3[0], timestamps3[-1] + 1)]))
# global clock to local clock mappings are ordered
s.add(And([And([Implies(i <= j, And(c0(i) <= c0(j), c1(i) <= c1(j), c2(i) <= c2(j), c3(i) <= c3(j))) for j in range(timestamps0[0], timestamps0[-1] + 1)]) for i in range(timestamps0[0], timestamps0[-1] + 1)]))
# consistent cut flow
c_flow = Function('c_flow', IntSort(), RealSort())
# c_flow = Function('c_flow', IntSort(), IntSort())
# addition
s.add(And([c_flow(i) == (tank0(c0(i)) + tank1(c1(i)) + tank2(c2(i)) + tank3(c3(i))) for i in range(timestamps0[0], timestamps0[-1] + 1)]))
# violation check
v = Real('v')
s.add(And(v >= timestamps0[0], v <= timestamps0[-1]))
s.add(ForAll(v, Implies(And(v >= timestamps0[0], v <= timestamps0[-1]), z3Interpolate(c_flow, v) >= 20)))
# s.add(z3Interpolate(c_flow, v) == 15)
# s.add(v == 10)
start = time.time()
if s.check() == sat:
m = s.model()
# out = "%s %s" % (m[test], m[test2])
# print(m)
end = time.time()
# else:
#
# print("unsat")
s.reset()
dur = end - start
return dur
def z3Interpolate(f, p):
return (f(ToInt(p)) + ((f(ToInt(p) + 1) - f(ToInt(p))) * (p - ToInt(p))))
def z3Abs(x):
return If(x >= 0, x, -x)
def z3SqDist3d(x1, x2, y1, y2, z1, z2):
return (((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1)) + ((z2 - z1) * (z2 - z1)))
def z3SqDist2d(x1, x2, y1, y2):
return (((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1)))
def z3SqDist1d(x1, x2):
return z3Abs(x2 - x1)
def getDataTank(agent_ID):
file = open('data/wt/s5_tank_{}'.format(agent_ID))
line = file.readline()
data = []
while line:
param = line.split('\t')
values = []
for i in range(2):
values.append(float(param[i].strip()))
data.append(values)
line = file.readline()
file.close()
# print(data)
return data
def main():
eps = 0.05
agents2 = True
agents3 = True
agents4 = True
if len(sys.argv) == 3:
epsTemp = max(float(sys.argv[1]), 0.01)
eps = min(epsTemp, 0.05)
agentsTemp = max(int(sys.argv[2]), 2)
agents = min(agentsTemp, 4)
if agents == 2:
agents3 = False
agents4 = False
if agents == 3:
agents2 = False
agents4 = False
if agents == 4:
agents2 = False
agents3 = False
print("Reproducing experiments...\n")
print("Pressure level safety property:\n")
repeat = 4
multiproc = False;
print("\tDuration 1s\t\tDuration 2s\t\tDuration 3s\t\tDuration 4s\t\tDuration 5s", end = "")
if agents2:
print("\n\n2 Tanks\t", end = "")
for i in range(5):
total_time = 0
if multiproc:
pool = multiprocessing.Pool()
inputs = [(eps, i + 1, 1) for j in range(repeat)]
outputs = pool.starmap(prog_tanks_pressure, inputs)
total_time = sum(outputs)
else:
for j in range(repeat):
start = time.time()
# prog_tanks_pressure(eps, i + 1, 1)
end = time.time()
dur = end - start
total_time += prog_tanks_pressure(eps, i + 1, 1)
print("{}\t".format(total_time / repeat), end = "")
if agents3:
print("\n\n3 Tanks\t", end = "")
for i in range(5):
total_time = 0
if multiproc:
pool = multiprocessing.Pool()
inputs = [(eps, i + 1, 1) for j in range(repeat)]
outputs = pool.starmap(prog_tanks_pressure_3, inputs)
total_time = sum(outputs)
else:
for j in range(repeat):
start = time.time()
# prog_tanks_pressure_3(eps, i + 1, 1)
end = time.time()
dur = end - start
total_time += prog_tanks_pressure_3(eps, i + 1, 1)
print("{}\t".format(total_time / repeat), end = "")
if agents4:
print("\n\n4 Tanks\t", end = "")
for i in range(5):
total_time = 0
if multiproc:
pool = multiprocessing.Pool()
inputs = [(eps, i + 1, 1) for j in range(repeat)]
outputs = pool.starmap(prog_tanks_pressure_4, inputs)
total_time = sum(outputs)
else:
for j in range(repeat):
start = time.time()
# prog_tanks_pressure_4(eps, i + 1, 1)
end = time.time()
dur = end - start
total_time += prog_tanks_pressure_4(eps, i + 1, 1)
print("{}\t".format(total_time / repeat), end = "")
print()
if __name__ == '__main__':
main()
pass