2024-12-15 14:40:03 +01:00
|
|
|
"""Abstract and base classes for optimization."""
|
|
|
|
|
|
|
|
|
|
from pydantic import ConfigDict
|
|
|
|
|
|
2025-10-28 02:50:31 +01:00
|
|
|
from akkudoktoreos.core.coreabc import (
|
|
|
|
|
ConfigMixin,
|
|
|
|
|
EnergyManagementSystemMixin,
|
|
|
|
|
PredictionMixin,
|
|
|
|
|
)
|
2024-12-15 14:40:03 +01:00
|
|
|
|
|
|
|
|
|
2025-10-28 02:50:31 +01:00
|
|
|
class OptimizationBase(ConfigMixin, PredictionMixin, EnergyManagementSystemMixin):
|
2024-12-15 14:40:03 +01:00
|
|
|
"""Base class for handling optimization data.
|
|
|
|
|
|
|
|
|
|
Enables access to EOS configuration data (attribute `config`) and EOS prediction data (attribute
|
|
|
|
|
`prediction`).
|
|
|
|
|
|
|
|
|
|
Note:
|
|
|
|
|
Validation on assignment of the Pydantic model is disabled to speed up optimization runs.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
# Disable validation on assignment to speed up optimization runs.
|
|
|
|
|
model_config = ConfigDict(
|
|
|
|
|
validate_assignment=False,
|
|
|
|
|
)
|