lsapy.SuitabilityFunction#
- class lsapy.SuitabilityFunction(func=None, name=None, params=None)[source]#
Suitability Function.
Suitability function define how the criteria indicator is transformed into a suitability value. The suitability function are available for continuous and discrete indicators. For continuous indicators, a membership function is applied to convert indicator values into a suitability. For discrete indicators, a set of rules is mapped on the indicator.
- Parameters:
func (Callable | None, optional) – Function to compute the suitability value.
name (str | None, optional) – Name of the implemented function to use (see Notes for available functions). If func is provided, this parameter is ignored.
params (dict[str, Any], optional) – Parameters of the function.
Notes
The implemented functions are (in parentheses the alternative names):
discrete,logistic,sigmoid,vetharaniam2022_eq3(VTR22_eq3),vetharaniam2022_eq5(VTR22_eq5),vetharaniam2024_eq8(VTR24_eq8),vetharaniam2024_eq10(VTR24_eq10).Examples
>>> func = SuitabilityFunction(name="logistic", params={"a": 1, "b": 5}) >>> func(3) array(0.11920292, dtype=float32)
SuitabilityFunctioncan also be used for discrete functions.>>> func = SuitabilityFunction(name="discrete", params={"rules": {1: 0, 2: 0.1, 3: 0.5, 4: 0.9, 5: 1}}) >>> func(3) array(0.5, dtype=float32)
Methods
__init__([func, name, params])plot(x)Basic plot of the suitability function.
Attributes
attrsDictionary of the suitability function attributes.