Files
DicePlayer/diceplayer/optimization/optimization_handler.py

29 lines
946 B
Python

from pathlib import Path
from diceplayer.config.player_config import RoutineType
from diceplayer.dice.dice_wrapper import DiceEnvironment
from diceplayer.state.state_model import StateModel
class OptimizationHandler:
def __init__(self, step_directory: Path):
self.dice_directory = step_directory / "dice"
def run(self, state: StateModel, current_cycle: int, dice_environment: list[DiceEnvironment]) -> StateModel:
routine = self._fetch_current_routine(state, current_cycle)
print(f"Running Optimization - {current_cycle} - {routine}")
print(dice_environment)
return state
@staticmethod
def _fetch_current_routine(state: StateModel, current_cycle: int) -> RoutineType:
if state.config.type != RoutineType.BOTH:
return state.config.type
if current_cycle < state.config.switch_cyc:
return RoutineType.CHARGE
return RoutineType.GEOMETRY