feat: enhance database models with metadata and new resource types
This commit is contained in:
@@ -17,6 +17,7 @@ from sqlalchemy.orm import Mapped, mapped_column, relationship
|
||||
from sqlalchemy.sql import func
|
||||
|
||||
from config.database import Base
|
||||
from .metadata import ResourceType, StochasticVariable
|
||||
|
||||
if TYPE_CHECKING: # pragma: no cover
|
||||
from .scenario import Scenario
|
||||
@@ -45,6 +46,12 @@ class SimulationParameter(Base):
|
||||
distribution: Mapped[DistributionType] = mapped_column(
|
||||
SQLEnum(DistributionType), nullable=False
|
||||
)
|
||||
variable: Mapped[StochasticVariable | None] = mapped_column(
|
||||
SQLEnum(StochasticVariable), nullable=True
|
||||
)
|
||||
resource_type: Mapped[ResourceType | None] = mapped_column(
|
||||
SQLEnum(ResourceType), nullable=True
|
||||
)
|
||||
mean_value: Mapped[float | None] = mapped_column(Numeric(18, 4), nullable=True)
|
||||
standard_deviation: Mapped[float | None] = mapped_column(Numeric(18, 4), nullable=True)
|
||||
minimum_value: Mapped[float | None] = mapped_column(Numeric(18, 4), nullable=True)
|
||||
|
||||
Reference in New Issue
Block a user