mirror of
https://github.com/OpenFusionProject/scripts.git
synced 2024-12-04 03:49:17 +00:00
Add option for score capping
This commit is contained in:
parent
073666e6f4
commit
4d6490933d
@ -27,6 +27,7 @@ import sqlite3
|
|||||||
|
|
||||||
LOGFILE = 'ogracing.log'
|
LOGFILE = 'ogracing.log'
|
||||||
DRY_RUN = False # set to True if testing the script
|
DRY_RUN = False # set to True if testing the script
|
||||||
|
CAP_SCORES = True # set to False to disable capping scores to the IZ maximum
|
||||||
|
|
||||||
class EpData:
|
class EpData:
|
||||||
max_score = 0
|
max_score = 0
|
||||||
@ -88,7 +89,7 @@ def process_result(cur, result, epinfo):
|
|||||||
pod_score = (epdata.pod_factor * result.ring_count) / epdata.max_pods
|
pod_score = (epdata.pod_factor * result.ring_count) / epdata.max_pods
|
||||||
time_score = (epdata.time_factor * result.time) / epdata.max_time
|
time_score = (epdata.time_factor * result.time) / epdata.max_time
|
||||||
newscore = int(exp(pod_score - time_score + epdata.scale_factor))
|
newscore = int(exp(pod_score - time_score + epdata.scale_factor))
|
||||||
if newscore > epdata.max_score:
|
if CAP_SCORES and newscore > epdata.max_score:
|
||||||
logging.warning('score {} greater than max ({}) for epid {}, capping'.format(newscore, epdata.max_score, result.epid))
|
logging.warning('score {} greater than max ({}) for epid {}, capping'.format(newscore, epdata.max_score, result.epid))
|
||||||
print('warning: score {} greater than max ({}) for epid {}, capping'.format(newscore, epdata.max_score, result.epid))
|
print('warning: score {} greater than max ({}) for epid {}, capping'.format(newscore, epdata.max_score, result.epid))
|
||||||
newscore = epdata.max_score
|
newscore = epdata.max_score
|
||||||
|
Loading…
Reference in New Issue
Block a user