Skip to content

Commit

Permalink
feat(single-race): ajust race score
Browse files Browse the repository at this point in the history
increase block rate by distance
  • Loading branch information
NateScarlet committed Jun 16, 2021
1 parent b611560 commit 2a9a2cd
Showing 1 changed file with 39 additions and 2 deletions.
41 changes: 39 additions & 2 deletions auto_derby/single_mode/race.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,11 +256,20 @@ def _running_style_single_score(
(12000, 0.8),
),
)
* mathtools.interpolate(
race1.distance,
(
(0, 2.0),
(1200, 2.0),
(2000, 1.0),
(3200, 0.6),
),
)
* block_factor
)
block_rate = min(1.0, block_rate)

stamina_penality = mathtools.interpolate(
sta_penality = mathtools.interpolate(
int(sta / expected_sta * 10000),
(
(0, 10.0),
Expand Down Expand Up @@ -301,8 +310,36 @@ def _running_style_single_score(
),
)
ret *= 1 - block_rate
ret *= 1 - stamina_penality
ret *= 1 - sta_penality
ret *= 1 - wis_penality

LOGGER.debug(
(
"style: "
"score=%d "
"block_rate=%.2f "
"sta_penality=%0.2f "
"wis_penality=%0.2f "
"spd=%0.2f/%0.2f "
"sta=%0.2f/%0.2f "
"pow=%0.2f/%0.2f "
"gut=%0.2f "
"wis=%0.2f/%0.2f"
),
ret,
block_rate,
sta_penality,
wis_penality,
spd,
expected_spd,
sta,
expected_sta,
pow_,
expected_pow,
gut,
wis,
expected_wis,
)
return ret


Expand Down

0 comments on commit 2a9a2cd

Please sign in to comment.