Add high-inning preference for AI lineups
This commit is contained in:
parent
1f917b8a6b
commit
ac14e8517e
@ -28,7 +28,7 @@ logging.basicConfig(
|
||||
|
||||
CARDSETS = {
|
||||
'ranked': {
|
||||
'primary': [9, 10, 13, 14, 15] # 2023, 23 Promos, 2018
|
||||
'primary': [9, 10, 13, 14] # 2023, 23 Promos, 2018
|
||||
},
|
||||
'minor-league': {
|
||||
'primary': [13, 8], # 2018, Mario
|
||||
|
||||
@ -198,6 +198,10 @@ def get_scouting_dfs(allowed_players, position: str):
|
||||
dict([(x.player.player_id, x.error) for x in positions]),
|
||||
name=f'Error {position}'
|
||||
))
|
||||
series_list.append(pd.Series(
|
||||
dict([(x.player.player_id, x.innings) for x in positions]),
|
||||
name=f'Innings {position}'
|
||||
))
|
||||
if position in ['LF', 'CF', 'RF']:
|
||||
series_list.append(pd.Series(
|
||||
dict([(x.player.player_id, x.arm) for x in positions]),
|
||||
@ -374,10 +378,14 @@ async def get_team_lineup(team_id: int, difficulty_name: str, pitcher_name: str,
|
||||
|
||||
r_mod = (3 - df_data[f'Range {position}']) * r_mult
|
||||
e_mod = df_data[f'Error {position}'] * e_mult
|
||||
i_mult = df_data[f'Innings {position}'] / 1000
|
||||
|
||||
# final_ops = df_data['total_OPS'] + r_mod + e_mod
|
||||
# final_ops = (df_data['total_OPS'] * i_mult) + r_mod + e_mod
|
||||
final_ops = (df_data['total_OPS'] + r_mod + e_mod) * i_mult
|
||||
logging.debug(f'{df_data.player_name} total OPS: {df_data.total_OPS} / '
|
||||
f'final OPS: {df_data.total_OPS + r_mod + e_mod}')
|
||||
return df_data['total_OPS'] + r_mod + e_mod
|
||||
f'final OPS: {final_ops}')
|
||||
return final_ops
|
||||
|
||||
if len(eligible_cards.index) >= 1:
|
||||
eligible_cards['final_ops'] = eligible_cards.apply(rank_cards, axis=1)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user