-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.py
60 lines (35 loc) · 1.18 KB
/
example.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
import sys
import math
from time import time
import numpy as np
import pickle
def AkcCont(free, beta,L,D,LK,DK,V):
akc=free
param=[L,D,LK,DK,V]
for i,j in zip(beta,param):
akc=akc+i*j
return np.clip(akc,-40,40)
def KorCont(beta,L,D,LK,DK,V):
akc=0
param=[L,D,LK,DK,V]
for i,j in zip(beta,param):
akc=akc+i*j
return np.clip(akc,-90,90)
def main():
#a1,a2,a3,a4,a5,a6, k1,k2,k3,k4,k5=list(np.load("Parametri.npy"))
start=time()
while True:
input_str = input() # lnIn - procitaj ulaze sa standardnog ulaza
(L,D,LK,DK,V,S, W, H, pos_x, pos_y) = [int(s) for s in input_str.split(" ") if s.isdigit()] # tu je kraj rjesen
input_str = input() # lnIn - procitaj ulaze sa standardnog ulaza
(a1,a2,a3,a4,a5,a6, k1,k2,k3,k4,k5) = [float(s) for s in input_str.split(" ") ]
betaA=[a1,a2,a3,a4,a5]
betaK=[k1,k2,k3,k4,k5]
akcel =int(AkcCont(a6, list(betaA),L,D,LK,DK,V))
#print(akcel, file=sys.stderr)
kormilo = int(KorCont(list(betaK),L,D,LK,DK,V))
#np.save("Output.npy",np.array([pos_x, pos_y, W, H, time()-start]))
print(akcel, kormilo)
sys.stdout.flush();
if __name__ == '__main__':
main()