Skip to content

Commit

Permalink
feat(single-mode): adjust race score
Browse files Browse the repository at this point in the history
  • Loading branch information
NateScarlet committed Jun 20, 2021
1 parent 3aca0af commit 1eaece0
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion auto_derby/single_mode/race.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,15 @@ def _running_style_single_score(
* block_factor
)
block_rate = min(1.0, block_rate)
block_penality = mathtools.interpolate(
int(block_rate * 10000),
(
(0, 1),
(1000, 0.8),
(2000, 0.5),
(3000, 0.3),
),
)

hp_penality = mathtools.interpolate(
int(hp / expected_hp * 10000),
Expand All @@ -311,7 +320,7 @@ def _running_style_single_score(
)

ret = spd / expected_spd * 10000
ret *= 1 - block_rate
ret *= 1 - block_penality
ret *= 1 - hp_penality
ret *= 1 - wis_penality

Expand All @@ -320,6 +329,7 @@ def _running_style_single_score(
"style: "
"score=%d "
"block_rate=%.2f "
"block_penality=%.2f "
"hp_penality=%0.2f "
"wis_penality=%0.2f "
"spd=%0.2f/%0.2f "
Expand All @@ -331,6 +341,7 @@ def _running_style_single_score(
),
ret,
block_rate,
block_penality,
hp_penality,
wis_penality,
spd,
Expand Down

0 comments on commit 1eaece0

Please sign in to comment.