Fixed min hovedet under armen kode
This commit is contained in:
parent
d275955296
commit
520ca077fd
60
pubeval.py
60
pubeval.py
|
@ -42,40 +42,38 @@ class Pubeval:
|
|||
0.00000, 3.42040
|
||||
]
|
||||
|
||||
def pubeval(race, pos):
|
||||
|
||||
if pos[26] == 15:
|
||||
return 99999999.0
|
||||
def pubeval(self, race, pos):
|
||||
|
||||
setx(pos)
|
||||
score = 0.0
|
||||
if race:
|
||||
for i in range(122):
|
||||
score = score + self.wr[i]*self.x[i]
|
||||
else:
|
||||
for i in range(122):
|
||||
score = score + self.wc[i]*self.x[i]
|
||||
return score
|
||||
if pos[26] == 15:
|
||||
return 99999999.0
|
||||
|
||||
def setx(pos):
|
||||
self.x = [0]*122
|
||||
|
||||
for j in range(122):
|
||||
self.x[j] = 0.0
|
||||
for j in range(1,25):
|
||||
jm1 = j-1
|
||||
n = pos[25-j]
|
||||
if n != 0:
|
||||
if n == -1:
|
||||
self.x[5*jm1+0] = 1.0
|
||||
if n == 1:
|
||||
self.x[5*jm1+1] = 1.0
|
||||
if n >= 2:
|
||||
self.x[5*jm1+2] = 1.0
|
||||
if n == 3:
|
||||
self.x[5*jm1+3] = 1.0
|
||||
if n >= 4:
|
||||
self.x[5*jm1+4] = (n-3)/2.0
|
||||
self.x[120] = -(pos[0]/2.0)
|
||||
self.x[121] = (pos[26]/15.0)
|
||||
|
||||
score = 0.0
|
||||
if race:
|
||||
for i in range(122):
|
||||
score = score + self.wr[i]*self.x[i]
|
||||
else:
|
||||
for i in range(122):
|
||||
score = score + self.wc[i]*self.x[i]
|
||||
return score
|
||||
|
||||
for j in range(1,25):
|
||||
jm1 = j-1
|
||||
n = pos[25-j]
|
||||
if n != 0:
|
||||
if n == -1:
|
||||
self.x[5*jm1+0] = 1.0
|
||||
if n == 1:
|
||||
self.x[5*jm1+1] = 1.0
|
||||
if n >= 2:
|
||||
self.x[5*jm1+2] = 1.0
|
||||
if n == 3:
|
||||
self.x[5*jm1+3] = 1.0
|
||||
if n >= 4:
|
||||
self.x[5*jm1+4] = (n-3)/2.0
|
||||
self.x[120] = -(pos[0]/2.0)
|
||||
self.x[121] = (pos[26]/15.0)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user