refactor: restructure dice environment handling and update Python version requirement
Some checks failed
build and upload / test (3.10) (push) Failing after 1m45s
build and upload / pypi-upload (push) Has been skipped

This commit is contained in:
2026-03-29 17:38:44 -03:00
parent 7e66c98f26
commit 2802f10013
9 changed files with 314 additions and 352 deletions

View File

@@ -1,19 +1,28 @@
from pathlib import Path
from diceplayer.config.player_config import RoutineType
from diceplayer.dice.dice_wrapper import DiceEnvironment
from diceplayer.dice.dice_wrapper import DiceEnvironmentItem
from diceplayer.environment import Atom
from diceplayer.logger import logger
from diceplayer.state.state_model import StateModel
from pathlib import Path
class OptimizationHandler:
def __init__(self, step_directory: Path):
self.dice_directory = step_directory / "dice"
self.optimization_directory = step_directory / "optimization"
def run(self, state: StateModel, current_cycle: int, dice_environment: list[DiceEnvironment]) -> StateModel:
def run(
self,
state: StateModel,
current_cycle: int,
dice_environment: list[Atom],
) -> StateModel:
routine = self._fetch_current_routine(state, current_cycle)
print(f"Running Optimization - {current_cycle} - {routine}")
logger.info(
f"Running Optimization - {current_cycle} - {routine} - {self.optimization_directory}"
)
print(dice_environment)
logger.info(dice_environment)
return state