23 lines
500 B
Python
23 lines
500 B
Python
from pydantic import BaseModel
|
|
from typing import Optional
|
|
|
|
class Target(BaseModel):
|
|
theta: float
|
|
value: float
|
|
result: Optional[float] = None
|
|
drift: float = 0.0
|
|
|
|
@classmethod
|
|
def max_drift(cls) -> int:
|
|
return 15
|
|
|
|
@classmethod
|
|
def max_drift_increment(cls) -> int:
|
|
return 1 # 10%
|
|
|
|
def minimum(self) -> float:
|
|
return self.value - (self.value * self.drift)
|
|
|
|
def maximum(self) -> float:
|
|
return self.value + (self.value * self.drift)
|