Functions¶
The Function
class and its derivatives allow representing a mathematical function that can be used for cost or penalty computation.
classDiagram
Function <|-- ConstantFunction
Function <|-- LinearFunction
Function <|-- PolynomialFunction
class ConstantFunction{
+int value
}
class LinearFunction{
+int slope
+int intercept
}
class PolynomialFunction{
+List[int] coefficients
}
ConstantFunction¶
\[ f(x) = K, \forall x \in \mathbb{N}\]
in python
LinearFunction¶
\[ f(x) = s \times x + i, \forall x \in \mathbb{N}\]
in python
PolynomialFunction¶
\[f(x)={a_n}x^n + {a_{n-1}}x^{n-1} + ... + {a_i}x^i + ... + {a_1}x+{a_0}\]