diff --git a/interfaces.py b/interfaces.py index e251378..d7a9c2d 100644 --- a/interfaces.py +++ b/interfaces.py @@ -1,17 +1,31 @@ from abc import ABC, abstractmethod -from dataclasses import dataclass -@dataclass -class Layer: - thermal_coefficient: float - thickness: float +class Layer(ABC): + @property + @abstractmethod + def R(self) -> float: ... + + +class MaterialLayer(Layer): + def __init__(self, thermal_coefficient: float, thickness: float): + self.thermal_coefficient = thermal_coefficient + self.thickness = thickness @property - def R(self): + def R(self) -> float: return self.thickness / self.thermal_coefficient +class FixedRLayer(Layer): + def __init__(self, r_value: float): + self.r_value = r_value + + @property + def R(self) -> float: + return self.r_value + + class Interface(ABC): @property @abstractmethod